For this endeavor I used the dir() command, all by means of VBA programming rather than macro recording, since there wasn’t a user action that I could record.
It helped that I already had a little experience with the dir() command to write a simple batch macro (for running any macro on all the files in a folder) with the guidance of a mentor of mine way back when MasterFormat was expanded to 6 digits.
For this new task of checking a TOC, I repurposed that code to examine each filename in the folder where the TOC document resides, and if the section number and title of the filename cannot be found in the TOC document, it gets added to a list of spec sections to copy & paste into the TOC. Sometime I will program them to automatically insert at the correct place, to save the copying and pasting hassle.
To detect specs that are on the TOC but not in the folder, a variation of the program checks every 6-digit number that can be found in the folder, optionally with period and 2 more digits for level 5 section numbers, and examines the folder contents to see if the document exists. This is useful not only for TOC checking, but also checking cross references within spec sections. I programmed it to highlight in turquoise and add [brackets] around any cross references not found in the folder.
The automation requires a strict filenaming convention of ######[.##] - Section Title. It saves so much time that I find it worthwhile using Advanced Renamer (free program) to rename the other consultants’ files when they can’t seem to follow the formatting instructions we sent out. If we’re right up against the deadline I’ll do it for them. Otherwise I show them how. Prior to finding Advanced Renamer I did this using Excel with VBA and a bit of DOS, which wasn’t at all user friendly.
My specific methods aren’t important to the conversation David started, but they are an example of why I think it could create some extra burden for a few spec writers if CSI were to mandate a file-naming convention that includes redundant information (such as project name, redundant because the folder itself surely has something unique like project name or number or something), unless specifiers are putting all their projects’ specs into a single folder. I’m not sure why anyone would need to do that. But if so, maybe make [ - Eastlake] an optional thing in the proposed filenaming convention?
I sometimes see other spec writers feel a strong need to use the end of the filenames as a code for which firm wrote each spec section. I have my own way of handling that through subfolders which contain their word files or a shortcut to their PDF if I only received a PDF.
I guess no filenaming convention will make everyone happy, and maybe I’m the weirdo in the room ;^) (zany face emoji 🤪 not working here).
Even if a filenaming convention is ever proposed, batted around, and finally recommended by CSI, there will be engineering consultants forever who put their own project number as a prefix or suffix anyway. If this is a problem you deal with often, you might like Advanced Renamer!