Watch this video to learn how to use field codes to add multiple tables of contents to a document.
In a very large complex document, it makes sense to provide readers with multiple Tables of Contents – one for each section.
And the way to do that is with, you guessed it, Field codes.
In Outline view, you can see that this sample document has three major sections filled with subsections.
To make it easier for the reader to navigate, let’s add a Table of Contents to each major section.
To do that, we’ll start by adding TC fields to each subsection heading. You’ll see how it works as we go along.
Click in front of the first subsection heading in the first section.
Then go to the INSERT tab, click Quick Parts, and Field.
Then scroll down and click TC. Type the name of the subsection, then check TC entry in doc with multiple tables.
This will add a switch to the code – the \f switch – that enables us to add multiple Tables of Contents.
Then, check Outline level and type 1. This will format the entry in the Table of Contents with the TOC 1 Style. Click OK.
Next, go to the HOME tab and Show/Hide Paragraph Marks, so we can see the field code.
There is the \f switch.
It enables us to add multiple Tables of Contents to a document by assigning a type identifier to the entry. Click after the 'f'.
We can use any letter as the identifier, but let’s just call this entry an 'x' type. Type space and 'x'.
Next, we need to mark the other subsection headings, and we can do that by simply selecting the field code and copying it.
Delete the text inside the quotation marks and type the subsection name.
After you finish one section, go to the next one. Change the text, and also change the identifier.
We’ll identify this section as 'y'. Go through all the subsection headings and add the 'y' type to the field code.
When you get to the third section, change the 'f' switch value to 'z'.
And then, add the field code to the other headings.
So when you finish, all the subsections are labeled 'x', 'y' or 'z', depending on which section they are in.
Now we’ll add the Tables of Contents. Click the line below the first section heading, then go to the REFERENCES tab, click Table of Contents, and Custom Table of Contents.
Click Options. Then, uncheck Styles and Outline levels, and check Table entry fields.
Now, Word will include only text that is marked with TC field codes. Click OK and OK.
The TOC field code is added, but no Table of Contents entries are found. Why is that? Press Alt+F9 to show the field code.
The 'f' switch was added to the code, but there is no type identifier.
And if none is added, Word looks for the default type 'c'.
Type 'x' after the 'f' switch. Then, right-click the code and Update Field. Press Alt+F9 to show the Table of Contents.
As planned, the Table of Contents shows only the headings in this section – the ones with type 'x' entries.
Next, you can copy the TOC field code to the other sections.
Change the 'f' switch to 'y', and then 'z'.
As a final touch, we’ll add a high-level Table of Contents at the beginning of the document.
Click Table of Contents and Custom Table of Contents. Select only one level, and click OK.
And the Table of Contents shows only Heading 1 Styled text.
So now you know how to customize an Automatic Table of Contents to show whatever text you want.
If you haven’t already, check out the other Table of Contents courses, and also learn more about field codes.
For more information about Tables of Contents and field codes, check out the links in the course summary.