In the last blog post, I showed you how to generate a table of contents based on built-in heading styles. If you're working with two or more documents, Word's table of contents feature won't work the same way, but it's not impossible - it isn't even hard. You'll use fields in a separate table of contents document.
Before you start, if possible, save the documents that comprise the table of contents to the same folder. This step isn't necessary, but it simplifies things a bit. When you're ready to build the table of contents, open a new document and save it using a descriptive name to identify it as a table of contents document.
In the table of contents document, insert a Reference Document field for each document that you want to include in the table of contents, as follows:
- Click the Insert tab.
- From the Quick Parts dropdown (in the Text group), choose Field.
- Choose RD from the Fields Names list (RD stands for reference document). In Word 2003, choose Field from the Insert menu.
- In the Filename or URL control, enter the name of the first document you want to include in the table of contents.
- If the document's in the same folder as the table of contents document, check the Path Is Relative To Current Doc option. Otherwise, be sure to enter the file's full path.
- Click OK.
At this point, you won't see anything, but don't worry. Press Enter and repeat the above process for each document you want to include in the table of contents. Reference files in the order of the content. Then, generate the table of contents as you normally would:
- Click the References tab.
- In the Table of Contents group, click Table of Contents.
- Choose an option from the gallery options. In Word 2003, choose Reference from the Insert menu and then select Index and Tables.
- If the control displays a field code instead of the table of contents, press [Shift]+[F9] to update the field.
Notice that the page numbers are all 1. That's because both documents in this example have just one page, and I didn't alter the page-numbering scheme for either - both documents begin with page number 1. When using this technique, you'll probably want to alter the page-numbering scheme for all but the first document. For instance, in this case, I'd start the second document with the page number 2, instead of 1. That calls for a bit of manual manipulation, but it's not difficult. It might be a bit time-consuming if you have many documents.
If you modify any of the referenced documents, you might have to update the beginning page number of some, maybe all, of the documents. It's not a perfect solution, but it works. There's no built-in function for basing a table of contents on multiple documents.
Susan Sales Harkins is an IT consultant, specializing in desktop solutions. Previously, she was editor in chief for The Cobb Group, the world's largest publisher of technical journals.