Thread: [Solved] Database from Word documents
View Single Post
 
Old 05-13-2020, 03:06 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,343
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

For VBA code to Combine Multiple Word Documents, see the Combine Multiple Word Documents 'Sticky' thread at the top of the Word VBA forum: https://www.msofficeforums.com/word-...documents.html. The documents will be combined in filename order.

Building a Table of Contents that would reference these documents depends on where, for example, the first paragraph in each source document uses the same Heading Style and that Heading Style is not used anywhere else in any of the source documents. That could be done by inserting each source document's name as the first paragraph in the new Sections created by the macro. That would result in a change to each inserted document's overall layout, however. Otherwise, you would need to employ TC fields (see Field codes: TC (Table of Contents Entry) field - Office Support) so that a Table of Contents field could reference them. These, too, could be inserted programmatically.

An alternative approach would be to create an entirely separate document that simply hyperlinks to each of the others, as per: https://www.msofficeforums.com/150273-post4.html

In either case, whether any new documents you might create and where they would appear in a Table of Contents on the hyperlinks in an index document depends entirely on where in the:
• combined document; or
• hyperlinks in an index document,
you insert the new one.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote