View Single Post
 
Old 01-13-2022, 05:18 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,977
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Macros require consistency in order to work consistently. If ALL your documents have exactly the same setup and formatting of titles never varies (and the same formatting is not used elsewhere). An alternative is to harvest paragraphs 2-4 from each document but again this is an indirect method of grabbing the info.

Creating code that searches for indirect arbitrary conditions (like TNR, 12pt, Bold) means that some documents created by knowledgeable but unaware authors are liable to not return results when they should and others are liable to return other content that they shouldn't.

The best solution would be to pre-check and standardise all your documents to ensure that the Title is defined in a non-ambiguous way. Ideally this would make use of a document property or content control. But it could also be searching for a style which is ONLY used for Title information.

The point of the macro including the filename column in the output is to provide a way for you to visually identify files which failed the consistency test so you can correct just those ones and make a second pass over the files. If a file doesn't appear in the Excel list then you know it didn't contain any text according to the conditions searched. If it does appear but contains too much text (or not the title info) then the formatting is incorrectly applied.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote