Adding Headers or Footers to a TOC

by Allen Wyatt
(last updated March 19, 2016)

9

Doreen wonders if information in headers or footers can be included in a table of contents and, if so, how to do it. She is not talking about having headers and footers appear on the same pages where the TOC appears; she knows how to do that. What she wants is for information that is placed in headers or footers to actually be a part of the TOC itself.

There are two ways you can approach this problem, depending on what you actually want included in the TOC. If you want the entire header or footer included, then the approach is rather straightforward:

  1. Make sure your headers and footers are using consistent styles. (I normally use the built-in Header and Footer styles for this.)
  2. Position the insertion point where you want your TOC.
  3. Display the References tab of the ribbon.
  4. At the left of the ribbon click the Table of Contents tool. Word displays a few options.
  5. Click Insert Table of Contents (Word 2007 and Word 2010) or Custom Table of Contents (Word 2013 and Word 2016). Word displays the Table of Contents dialog box.
  6. Click on the Options button. Word displays the Table of Contents Options dialog box. (See Figure 1.)
  7. Figure 1. The Table of Contents Options dialog box.

  8. In the list of styles, find the Header style (or whatever style you used for your headers). Change the TOC Level column to reflect which TOC level you want associated with your headers.
  9. In the list of styles, find the Footer style (or whatever style you used for your footers). Change the TOC Level column to reflect which TOC level you want associated with your footers.
  10. Click on OK to close the Table of Contents Options dialog box.
  11. Click on OK to close the Table of Contents dialog box and generate the table of contents.

If you don't want the entire header or footer, but instead only want a portion of the text in that header or footer, then you can use TC fields to include extra information in the TOC. The idea is to bookmark whatever text you want included in the TOC, and then create a TC field that references that bookmark. Finally, when creating the TOC, simply indicate that you want TC fields included in what Word generates. Here are the actual steps:

  1. In the header or footer, select and bookmark the actual text you want included in the TOC. Give the bookmark a unique name, such as MyTOCText.
  2. Position the insertion point at the top of the page (for headers) or bottom of the page (for footers), but still within the body of the text.
  3. Press Ctrl+F9. Word inserts a pair of field braces.
  4. Inside the braces type the following: TC \l 1
  5. Position the insertion point between the two spaces that follow the TC field code.
  6. Again press Ctrl+F9. Word inserts another pair of field braces.
  7. Type the following: REF MyTOCText. Your completed field should look like this:
  8.         { TC {REF MyTOCText} \l 1}
    
  9. Select the entire field and press Shift+F9 to collapse it all. (You may have to press it twice since there are two fields in play.)
  10. Position the insertion point where you want your TOC.
  11. Display the References tab of the ribbon.
  12. At the left of the ribbon click the Table of Contents tool. Word displays a few options.
  13. Click Insert Table of Contents. Word displays the Table of Contents dialog box.
  14. Click on the Options button. Word displays the Table of Contents Options dialog box.
  15. In the list of available options, make sure the Table Entry Fields check box is selected.
  16. Click on OK to close the Table of Contents Options dialog box.
  17. Click on OK to close the Table of Contents dialog box and generate the table of contents.

The table of contents should now be generated, and it should include the information that you wanted from your header or footer. While the TC field you inserted may still be visible on the screen, it should not print.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (2698) applies to Microsoft Word 2007, 2010, 2013, and 2016.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He  is president of Sharon Parq Associates, a computer and publishing services company. ...

MORE FROM ALLEN

Page Layout Zoom Settings

The zoom setting at which you view a document can sometimes be saved with a document. This tip explains how the zoom setting ...

Discover More

Setting Gap Spacing in the Equation Editor

The Equation Editor is a great tool that allows you to add equations to your document. You have quite a bit of control over ...

Discover More

Easily Backing Up AutoText Entries

Many people use AutoText to enhance their use of Word. If you've invested significant time in customizing AutoText to make it ...

Discover More

Do More in Less Time! Are you ready to harness the full power of Word 2013 to create professional documents? In this comprehensive guide you'll learn the skills and techniques for efficiently building the documents you need for your professional and your personal life. Check out Word 2013 In Depth today!

More WordTips (ribbon)

Hyperlinks from Headings to the TOC

A table of contents is a great way to help organize lengthy documents. In a default TOC, you can use each entry as a ...

Discover More

Adding Column Headings to a Table of Contents

Word makes it easy to create a Table of Contents. If you want column headings in that table, getting them takes a bit of ...

Discover More

Creating a TOC that Includes Specific Styles

Want to create a special TOC that contains different elements of your document? It's easy to do if you consistently use ...

Discover More
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.

Comments

If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is two more than 4?

2016-04-05 08:05:25

Ken Endacott

Click ALT+F9 to toggle between the display of fields including braces and the display of field results.

If you have a TOC then ALT+F9 will display the TOC field and you can check that the TOC field contains a f switch. Then ALT+F9 to display the TOC again.


2016-04-04 08:05:15

Raymond

I am sorry, but method one does not work as described above in Word 2016. If I follow these steps, only body text that is marked with style 'Header' of 'Footer' is shown in the TOC. Actual headers of footers, which use these same styles, are not listed in the TOC (and that was the question, if I understood it correctly).

As for method 2: when I press CTRL+F9 at the top of my page, the braces appear indeed. When I start typing between the braces, the braces disappear, so I cannot position my cursor as described in step 5. This method needs some more clarification, because it will raise a lot of questions the way it is described now.


2016-03-22 12:33:05

Ken Endacott

In Word 2007 and 2010, method 1 does not work because TOC entries cannot come from headers or footer only from the document body.

I don't know if the same applies in Word 2013 and 2016


2016-03-21 06:44:08

Ken Endacott

The TC method uses nested fields ie one field inside another. A TC field has the format { TC "Text to display" l 1 } where "Text to display" will appear in the TOC at level 1. If a REF field that refers to bookmarked header of footer text is used instead of text then the REF field is evaluated first and the resultant text is then used by the TC field.

Note that fields require special curly brackets and not the curly brackets on your keyboard. CTRL/F9 generates a pair of field brackets.

The TC field must be located in the document body, its position determines where it appears in the TOC relative to other entries. For example a header TC field might be placed at the top of the first page that has headers. A footer TC field might be placed at the bottom of the last page.

To make TC fields appear in the TOC it is necessary to place a f switch in the TOC field. This can be achieved in the TOC menu as described in step 14 or it can be added manually to the TOC field. The TOC field should then look like:

{ TOC o "1-3" f h z u }


Incidentally, TC fields are also useful for such things as generating TOC entries that are abbreviated headings and sub headings.


2016-03-21 04:48:01

Richard

I need some help with this one as well. I'm using Word 2007 on Win7.


2016-03-20 15:45:16

Calvin Wilson

@ Alice Walton

I also tried both methods without success.

I entered text in the header and formatted it with the Header style as suggested. In the Table of Contents Options dialog box, I located the Header style (step 8) and set the TOC Level value to 1 so the formatted text would be a first level entry in the TOC.

I also formatted the text in the header as Heading 1.

The text in the header simply isn't recognized when the TOC is created.

I am using Word 2010.


2016-03-20 12:02:30

Alice Walton

I have tried both options and did not get any results. In the second option --using TC fields -- I noticed that in step 4. the field is {TC l 1}, but in the final field there are two ones
{ TC {REF MyTOCText} l 1}.
In the first option, where Allen states in the instructions to open the TOC Options dialog box, I am missing something here for step 8. Is Allen saying to scroll down to find header or footer and put the TOC level that you want associated with your headers or footers? This just does not work and I am totally baffled. Does anyone have any suggestions? Thank you, AW


2016-03-19 15:34:51

Penny Edwards

If you want a separate table of contents for a section, you will need to bookmark the section. Then using the TOC field, add the b option and enter the name of your bookmark. This will give you a TOC for the bookmarked section.


2016-03-19 10:32:33

John Cheek

I have a document with two sets of table of contents. One is at the beginning of the document, the other in a separate section halfway through the document. How do I set this up?


This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.

Newest Tips
Subscribe

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.