Adding Headers or Footers to a TOC

Written by Allen Wyatt (last updated February 7, 2022)
This tip applies to Word 2007, 2010, 2013, and 2016


12

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

Using Named Formulas or Constants

An easy way to create a name for a formula or constant value. The name can then be used in other formulas or for ...

Discover More

Changing Gridline Color

Gridlines are very helpful in seeing where cells are located on the screen. You are not limited to black gridlines; ...

Discover More

Leading Zeros in Page Numbers

Page numbers in Excel printouts are typically simple counters, without much chance for embellishment. If you want to add ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More WordTips (ribbon)

Using Dot Leaders in Special Tables

Adding dot leaders before page numbers in a table of contents or table of authorities can make the finished table look ...

Discover More

Creating a Table of Contents from TOC Fields

If you inserted a bunch of TOC fields in your document, you can create your table of contents quite easily based on those ...

Discover More

Customized Tables of Contents

Generating a table of contents is easy in Word. Changing how that table of contents looks is also easy, provided you ...

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}] (all 7 characters, in the sequence shown) 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 6 - 0?

2023-10-20 04:53:16

WarwickWr

What about including headings within Endnotes? I have some endnotes which are effectively Appendices, which include the same heading levels as in the bulk of te document. None of these appear in the TOC. Is it possible to make these appear in the TOC? Specifically, I have the standard Heading1, Heading2 and Heading3 making up the basis for the TOC. All three appar in the Endnotes but none of these apper in the TOC.


2019-10-04 10:29:08

Martin

I was kind of hoping that I could get this to work as there are times where I could use this. I am using the latest MS word frustration, what ever name that goes by today. I run into the same issue as Raymond where as soon as I started typing within the curly brackets they disappeared, never to return. And what is the character right after the slash anyway?

Ken mentioned an "f" switch in the TOC field which I did not have and adding it did not make any difference. This is what Alt F9 changes the Table of Contents field to: {TOC\o"1-3"\f \h \z \t "Header,4,Footer,4" } Not sure of the actual spacing, and I added the \f switch.

Considering that every comment here, other than those made by Ken, who seems to know how to do this already, were made in frustration I have to concur with Robert, this tip needs much better explanation.


2019-05-04 16:57:19

Robert Shields

This is an almost useless explanation! Without an illustrated example this non-pedagogic explanation is just a plain irritating waste of time. Mate, you seem to have no idea of how to illustrate a proper example. I doubt very much anyone who has tried to follow this has succeeded as it makes no sense to anyone who does not already know how to do it.

If you want to know how to structure a proper explanation, contact me.


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.

Videos
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.