View Single Post
 
Old 06-27-2012, 07:30 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Hi Rattykins,

There are numerous ways the formatting could be done.

The code I posted simply gathers up all the data, looping through all the source documents to do so, and only once that's done does it output the results to the active document. It would be just as feasible to output the results as each source file is processed - either on a whole-of-file basis or on a per item (filename/bookmark, etc) basis. This gives a great deal of flexibility for formatting considerations - the method to be employed all depends on a combination of what you're comfortable with and what the required end result is.

For example, suppose you wanted all the filenames in bold. One way would be to output those as the loop progresses, apply the bold attribute, then output the bookmark data without the bold attribute. Another would be to output all the data as is now done, convert it to a table, bold whatever's in the first column, then convert the table back to text again. Just as effective, and possibly faster. Yet another would be update the output document at the end of each file's processing, then bold whatever appears on the new line up to the first tab. As you can see, with just this one example, there's at least three ways of handling the 'problem'. Any/all of these could be handled by adding code to the existing macro or by building a separate macro that the existing one calls.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote