WD: XD1033: How to Create a Table of Contents in Word

ID: Q127249

The information in this article applies to:

SUMMARY

Microsoft offers an Application Note called "How to Create a Table of Contents" (XD1033) that consolidates all how-to information about creating tables of contents (and tables of figures, tables of photos, and so forth) in a Microsoft Word document.

For complete information, see the "To Obtain This Application Note" section at the end of this article.

THE TEXT OF XD1033

  Microsoft(R) Product Support Services Application Note (Text File)
               XD1033: HOW TO CREATE A TABLE OF CONTENTS
                                                   Revision Date: 5/95
                                                      No Disk Included

The following information applies to Microsoft Word, version Word 2.0 and 6.0 for Windows and Word 6.0 for the Macintosh.

 ---------------------------------------------------------------------
| INFORMATION PROVIDED IN THIS DOCUMENT AND ANY SOFTWARE THAT MAY     |
| ACCOMPANY THIS DOCUMENT (collectively referred to as an Application |
| Note) IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER      |
| EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED      |
| WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR       |
| PURPOSE. The user assumes the entire risk as to the accuracy and    |
| the use of this Application Note. This Application Note may be      |
| copied and distributed subject to the following conditions:  1) All |
| text must be copied without modification and all pages must be      |
| included;  2) If software is included, all files on the disk(s)     |
| must be copied without modification (the MS-DOS(R)  utility         |
| diskcopy is appropriate for this purpose);  3) All components of    |
| this Application Note must be distributed together;  and  4) This   |
| Application Note may not be distributed for profit.                 |
|                                                                     |
|                                                                     |
| Copyright (C) 1995 Microsoft Corporation.  All Rights Reserved.     |
|                                                                     |
| Microsoft, MS-DOS, and Windows are registered trademarks of         |
| Microsoft Corporation.                                              |
| Macintosh is a registered trademark of Apple Computer, Inc.         |
| WordPerfect is a registered trademark of WordPerfect Corporation.   |
 ---------------------------------------------------------------------

                             INTRODUCTION
                             ============

This Application Note tells how to create a table of contents in a Microsoft Word document. A table of contents is a list at the beginning of the document that tells what the topics of the document are and what pages they appear on. It lists them in order of appearance. This Application Note also tell how to create other types of tables, such as a table of figures or a table of photos.

A table of contents is easy to create in Word. There are several ways to create them, and this Application Note explains how to determine the best method for you to use. This Application Note includes instructions for Word for Windows, versions 2.0 and 6.0, and Word for the Macintosh, version 6.0. Troubleshooting steps for when things don't look right are also given.

Creating a table of contents in Word is a two-step process. The first step is to mark the document so that Word knows which text to include in the table of contents. The second step is to build the table of contents. When you build the table, Word looks through the document for all the marked text. It lists the marked text in order and determines what page each item is on.

HOW SHOULD I MARK MY TEXT?

Microsoft Word offers two methods of marking the text you want to include in a table of contents: applying styles and using TC field codes. (A style is a collection of formatting. For example, a style named Title could be defined as centered with bold, 24-point Arial formatting.) You can choose whichever method best suits the needs of the document you have created. The results will look the same, although using TC field codes offers more flexibility.

In Word version 6.0, there is a third method of building a table of contents. You can use both methods of marking text concurrently, and Word will compile a table using the text marked both with styles and TC fields. In Word version 2.0, only one method at a time can be used.

In Word version 6.0, you can use any styles (not just heading styles) to mark text. In Word version 2.0, only heading styles can be used. lBoth methods of marking text are explained in detail in this Application Note in the "Microsoft Word Version 6.0" section that begins on page 4 and the "Microsoft Word Version 2.0 for Windows" section that begins on page 16.

UPDATING THE TABLE OF CONTENTS

Entries in the table of contents and the page numbers on which they appear will be accurate the first time you build the table. But if you mark new text or delete existing text, or if the number of pages in the document changes, you will need to update the table of contents.

The table of contents is actually the result of a TOC field code. To update the table, turn field codes and hidden text off, place the insertion point within the table, and press F9. Word can also update all the fields in the document (including fields such as PAGE, DATE, and TOC) automatically when you print the document. To turn the Update Fields option on, choose Options from the Tools menu, select the Print tab or category, and under Printing Options select the Update Fields check box. To turn the option off, clear the check box.

TIPS TO REMEMBER

METHOD 1: BUILDING A TABLE OF CONTENTS WITH HEADING STYLES

Mark the most important text in the document with Heading 1 style. In this Application Note, the sections titled "Introduction," "Microsoft Word Version 6.0," "Microsoft Word Version 2.0 for Windows," and "Troubleshooting Problems in Word 2.0 and Word 6.0" are all marked with Heading 1 style. Mark the next-most important text with Heading 2 style. In this section, "Method 1: Building a Table of Contents with Heading Styles," "Method 2: Building a Table of Contents with Field Codes," and "Using Shortcut Keys to Speed Work" are some of the sections we have marked with Heading 2 style.

When you build the table of contents, text marked with Heading 1 style will appear at the left edge of the table of contents, text marked with Heading 2 style will be indented about .25 inch, text marked with Heading 3 style will be indented about .5 inch, and so on. You can change the indents by formatting the table of contents. (This is explained in the "Formatting the Table of Contents" section on page 9 of this Application Note.)

Step 1: Mark the Text You Want in Your Table

To mark text using the menu

1. Place the insertion point on the text you want to include in the table

   of contents.

2. From the Format menu, choose Style.

3. In the Styles list, choose Heading 1.

4. Choose Apply.

To mark the text using the mouse

1. Place the insertion point on the text you want to include in the

   table of contents.

2. On the Formatting toolbar, click the down arrow of the Style list.

3. Select Heading 1.

Step 2: Build a Table of Contents with Heading Styles

1. Place the insertion point where you want the table of contents to

   appear.

2. From the Insert menu, choose Index And Tables.

3. Select the Table Of Contents tab.

4. In the Formats list, select the format you want to use.

5. Choose OK.

Building a Table of Contents with Other Styles

1. Mark the text as described in "Step 1: Mark the Text You Want in Your

   Table," but use any styles you like, not just heading styles.

2. Place the insertion point where you want the table of contents to
   appear. From the Insert menu, choose Index And Tables.

3. Select the Table Of Contents tab.

4. In the Formats list, select the format you want to use.

5. Choose the Options button. A list of all the styles used in the

   document appears.

6. Select the style you used to mark the text. In the TOC Level column,
   type the level number you want. Typically, this number is "1". Repeat
   this step for each style that marks text you want to include in the
   table.

7. Choose OK.

8. Choose OK again.

METHOD 2: BUILDING A TABLE OF CONTENTS WITH FIELD CODES

Step 1: Mark the Text You Want in Your Table

Use this method to select specific parts of your text that you want appear in the table of contents.

To mark text for inclusion in the table of contents:

1. Select the text you want to include, and press ALT+SHIFT+O (Windows) or

   COMMAND+OPTION+SHIFT+O (Macintosh). The Mark Table Of Contents Entry box
   appears:

   If you want different text to appear in the table of contents, change
   the text in the Entry box.

   To mark the entry for inclusion in a table of figures or any other type
   of table, choose a different letter in the Table Identifier box.

   To assign a different indent level to the text, change the number in the
   Level box. (The level indicates the importance of the text. In this
   Application Note, "Introduction" and "Microsoft Word Version 6.0" are
   level 1 entries. "Method 1" is a level 2 entry; "Step 1" is a level 3
   entry.)

2. Choose Mark when you're done. Word creates a TC field in the document,
   formatted with hidden text, that contains the text you selected.

3. If you want to mark another item in the document, you can click in the
   document, and the Mark Table Of Contents Entry box will remain on the
   screen. Highlight the text you want to mark. Click the Mark button. You
   can continue scrolling through the document, selecting words for the
   table of contents and clicking the Mark button.

4. Choose Close.

Step 2: Build a Table of Contents with TC Fields

1. Place the insertion point where you want the table of contents to

   appear.

2. From the Insert menu, choose Index And Tables.

3. Select the Table Of Contents tab.

4. Select the Format you want.

5. Choose the Options button.

6. Clear the Styles check box.

7. Select the Table Entry Fields check box.

8. Choose OK.

9. Choose OK again.

METHOD 3: BUILDING A TABLE OF CONTENTS WITH BOTH STYLES AND FIELDS

Mark the text as described in Step 1 of "Method 1: Building a Table of Contents with Heading Styles" on page 4 and Step 1 of "Method 2: Building a Table of Contents with Field Codes" on page 6. When you are ready to insert the actual table of contents, do the following:

1. Place the insertion point where you want the table of contents to

   appear.

2. From the Insert menu, choose Index And Tables.

3. Select the Format you want.

4. Choose the Options button.

5. Under Build Table Of Contents From, select both Styles and Table Entry

   Fields.

6. Choose OK.

7. Choose OK again.

USING SHORTCUT KEYS TO SPEED WORK

There are several keystrokes you can use to quickly update the table of contents or to apply heading styles to paragraphs.

   Action                 Word 6.0 for Windows    Word for the Macintosh
                          Keystroke               Keystroke
   ---------------------------------------------------------------------

   Show all characters    CTRL+SHIFT+8            COMMAND+8
   Promote a paragraph    ALT+SHIFT+LEFT ARROW    OPTION+SHIFT+LEFT
   (change from Normal                            ARROW
   style to Heading 1
   style, from Heading 1
   to Heading 2, and so
   on )
   Demote a paragraph     ALT+SHIFT+RIGHT ARROW   OPTION+SHIFT+RIGHT
   (change from Heading 2                         ARROW
   to Heading 1, and so
   on)
   Apply Normal style     CTRL+SHIFT+N or         COMMAND+SHIFT+N
                          ALT+SHIFT+5 (on the
                          numeric keypad with
                          NUM LOCK off)
   Apply Heading 1 style  CTRL+ALT+1              COMMAND+OPTION+1
   Apply Heading 2 style  CTRL+ALT+2              COMMAND+OPTION+2
   Apply Heading 3 style  CTRL+ALT+3              COMMAND+OPTION+3
   Insert field braces    CTRL+F9                 COMMAND+F9
   Update fields          F9 or ALT+SHIFT+U       F9 or
                                                  COMMAND+OPTION+SHIFT+U
   Normal View: Switch    SHIFT+F9                SHIFT+F9
   between one field and
   its result
   Page Layout View:
   Switch between all
   fields and their
   results
   Switch between all     ALT+F9                  OPTION+F9
   fields and results
   Unlink a field         CTRL+SHIFT+F9 or        COMMAND+SHIFT+F9 or
                          CTRL+6                  COMMAND+6
   Go to the next field   F11                     F11
   Go to the previous     SHIFT+F11               SHIFT+F11
   field
   Lock a field           CTRL+F11 or CTRL+3      COMMAND+F11 or
                                                  COMMAND+3
   Unlock a field         CTRL+SHIFT+F11          COMMAND+SHIFT+F11
   Bring up the Mark Text ALT+SHIFT+O             COMMAND+OPTION+SHIFT+O
   dialog box

CREATING A TABLE OF CONTENTS OR INDEX IN A SEPARATE DOCUMENT

Reference document (RD) fields allow you to create a document that consists only of a table of contents or an index. This can be useful if the chapters of the document are in separate files and you want to keep them separate for organizational or size purposes.

To create a document that consists only of a table of contents:

1. Start a new document.

2. Display hidden text by clicking the Show/Hide button.

3. Display field codes by pressing ALT+F9 (Windows) or OPTION+F9

   (Macintosh).

4. From the Insert menu, choose Field.

5. From the Categories list, select Index And Tables.

6. From the Field Names list, select RD.

7. Click in the Field Codes box. After RD (space) type the name of the first file you want to include in the table of contents. Choose OK.

NOTE: In Word for Windows, if you are typing a full path, you must type the backslashes twice. For example, if the file is called INTRO.DOC and is located in the C:\MSOFFICE\WINWORD directory, you must type C:\\MSOFFICE\\WINWORD\\INTRO.DOC in the Field Codes box after RD.

NOTE: In Word for Windows 95, version 7.0, if the filename or path contains spaces, you must also enclose the path and filename in quotation marks. For example, if the file is called INTRO 1.DOC and is located in the C:\MY DOCUMENTS directory, you must type "C:\\MY DOCUMENTS\\INTRO 1.DOC" in the Field Codes box after RD.

NOTE: In Word for the Macintosh, if the file or path name contains spaces, you must enclose the path and filename in quotation marks. For example, if the file is called INTRO and is located in Macintosh HD:Microsoft Office:Word, you must type "MACINTOSH HD:MICROSOFT WORD:INTRO" in the Field Code box after HD.

8. Repeat steps 4 through 7 for each file that contains text you want to

   include in the table of contents.

9. Position the text insertion point where the desired Table of Contents or
   Index should appear.

10. To build the table of contents follow the steps described in "Step 2:
   Build a Table of Contents with Heading Styles" or "Step 2: Build a Table
   of Contents with TC Fields." To build the Index, select Index and Tables
   from the Insert menu, select the desired format and choose OK.

In Word for Windows, version 6.0, with field codes and hidden text on, your document will look like the following example:

   { TOC } or { INDEX }

   { RD c:\\msoffice\\winword\\intro.doc }

   { RD c:\\msoffice\\winword\\chapter1.doc }

   { RD c:\\msoffice\\winword\\chapter2.doc }

   { RD c:\\msoffice\\winword\\chapter3.doc }

In Word for Windows 95,version 7.0, with field codes and hidden text on, your document will look like the following example:

   { TOC } or { INDEX }

   { RD "c:\\my documents\\intro 1.doc" }

   { RD "c:\\my documents\\chapter1.doc" }

   { RD c:\\msoffice\\winword\\chapter2.doc }

   { RD c:\\msoffice\\winword\\chapter3.doc }

NOTE: The quotation marks are only required when spaces are present in the file or path name.

In Word for the Macintosh, versions 6.0 and 6.0.1, with field codes and hidden text on, your document will look like the following example:

   { TOC } or { INDEX }

   { RD "Macintosh HD:Microsoft Word:intro.doc" }

   { RD "Macintosh HD:Microsoft Word:chapter1.doc" }

   { RD "Macintosh HD:Microsoft Word:chapter2.doc" }

   { RD "Macintosh HD:Microsoft Word:chapter3.doc" }

NOTE: The quotation marks are only required when spaces are present in the file or path name.

FORMATTING THE TABLE OF CONTENTS

When you create a table of contents, Word automatically applies a standard style to each entry. Word formats first-level entries with the style TOC 1, second-level entries with TOC 2, third-level entries with TOC 3, and so on. These standard TOC styles are built in to Word and have preset formats (for example, each level is indented by .25 inch). You can change how the table of contents looks by modifying these styles.

Note that in Word version 6.0, selecting a format for the table of contents from the Index And Tables dialog box will change the current TOC styles to the format that you selected. In other words, if you modify the TOC styles and then reinsert (replace) the table of contents using the menu (rather than updating the existing table by pressing F9), the changes you made will disappear. Your styles will be replaced with the standard, built-in TOC styles.

For information about modifying standard styles, see the "Modifying the Formats of a Style" section in Chapter 9 ("Automatic Formatting and Styles") of the "Microsoft Word User's Guide".

SWITCHING FROM WORDPERFECT

Creating a table of contents in Word is similar to creating one in WordPerfect. In WordPerfect, creating a table of contents consists of three steps: marking text, defining the table of contents, and generating the table of contents. In Microsoft Word, there are only two steps: marking text and building the table of contents.

How Word and WordPerfect Differ

Word's method of marking text for the table of contents is different from WordPerfect's method. In WordPerfect, a code appears at the beginning of text that is to be included, and a code appears at the end. These codes are visible when Reveal Codes is turned on. In Microsoft Word, you can mark the text by applying a certain style to it, or you can place a copy of the text to be included in a field.

Converting Existing WordPerfect Documents

When you open a WordPerfect document that contains a table of contents in Word 6.0, the table of contents displays as it was originally created in WordPerfect. Once you update the table of contents, however, all table of contents text becomes left justified. This is because table of contents entries in WordPerfect documents are converted as first-level entries in Word for Windows.

To change the indent levels of the table of contents entries, edit the field codes:

1. Show hidden text by selecting the Show/Hide button on the formatting

   toolbar.

2. Show field codes choosing Options from the Tools menu, selecting the
   View tab, and selecting the Field Codes check box. Choose OK. Or, press
   ALT+F9 (Windows) or OPTION+F9 (Macintosh) to toggle display of field
   codes.

3. Move to the field code you want to change. Place the insertion point to
   the left of the right-most field bracket.

4. Type \L, a space, and the level number. For example, change this field

        { TC "COOKING UTENSILS" }

   to this:

        { TC "COOKING UTENSILS" \L 2}

5. When you're finished making changes to the field codes, hide hidden text
   and hide field codes.

6. Update the table of contents by moving the insertion point to the table
   and pressing F9. Select the option to Update Entire table.

SUPPRESSING PAGE NUMBERS

Word version 6.0 includes an option to hide page numbers. If you do not want to include page numbers in your table of contents, follow these steps:

1. Place the insertion point where you want the table of contents to

   appear.

2. From the Insert menu, choose Index And Tables.

3. Select the Table Of Contents tab.

4. Select the desired format.

5. Clear the Show Page Numbers check box.

6. Choose OK.

   NOTE: There is no way to directly suppress page numbers for individual
   TOC levels--that is, "it's all or nothing." If need be, you can manually
   edit the table of contents after it is generated, but further updates to
   the table of contents will replace all of the page numbers. To prevent
   the table of contents from further updates, place the insertion point in
   the table of contents and press CTRL+F11 to lock the field code.
   CTRL+SHIFT+F11 will unlock the code if you want to update it later on.

INCLUDING CHAPTER NUMBERING

Using Word version 6.0 you can apply chapter numbers to paragraphs with the heading styles applied. You can format your document so that the chapter numbers are included in the table of contents. Formatting a document in this way also ensures that chapter numbers are included in the index.

1. Use styles to mark the text you want to designate as chapter headings:

   Apply the style Heading 1 to each paragraph that is a chapter title. Do
   not label or number the headings. Word will do that automatically when
   you complete step 2. For example, do not precede the heading with
   "Chapter 1".

2. Format the chapter labeling and numbering:

   a. From the Format menu, choose Heading Numbering.

   b. From the Heading Numbering dialog box, select the chapter
      numbering format you want to use. In this example, we have
      selected "Chapter 1".

   c. Choose the Modify button.

   d. With Level 1 appearing in the Level box (the box below the Help
      button), select the formats you want to use from the Number
      Format boxes. In this example, we have replaced the space in the
      Text After box with a colon followed by a space (": ").

   e. When you are satisfied with the results in the Preview box,
      choose OK.

3. To include chapter numbers and page numbers in the table of
   contents page numbering (for example, "1-1"), use the following
   steps:

   a. From the Edit menu, choose Select All.

   b. From the Insert menu, choose Page Numbers.

   c. Choose the Format button.

   d. Select the Include Chapter Number box. In the Chapter Starts
      With Style box, select Heading 1.

   e. Choose OK.

   f. Choose Close. Do not choose the OK button or you will insert
      page numbers in your document.

INCLUDING CHAPTER AND APPENDIX HEADINGS IN THE TABLE OF CONTENTS

The following procedure tells how to (1) mark and automatically label and number your chapter headings and appendix headings, (2) format the way page numbers appear in each section of your document, and (3) have both chapter headings and appendix headings (with their formatted page numbers) appear in the table of contents.

Automatic numbering of chapter and appendix headings is useful when you want to move, add, or delete chapters and appendixes without having to manually renumber them. For example, if you start out with a document that includes nine chapters and three appendixes and then you add one chapter, delete two others, and switch the order of the appendixes, Word will automatically renumber all the chapter and appendix headings and update the entire table of contents accordingly when you update the document.

To automate the labeling and numbering of chapter and appendix headings, format the page numbering, and include chapter and appendix headings in the table of contents, do the following:

1. Use styles to mark the text you want to designate as chapter

   headings and appendix headings:

   a. Apply the style Heading 1 to each paragraph that is a chapter
      title. Do not label or number the headings. Word will do that
      automatically when you complete step 2. For example, do not
      precede the heading with "Chapter 1".

   b. Apply a different heading style to each paragraph that is an
      appendix title. Use a style that isn't used anywhere else in the
      document. In this procedure, we will use Heading 9 to label all
      appendix titles. Do not label or number the headings.

      NOTE: If you are applying styles by choosing the Style list on
      the Formatting Toolbar, Heading 9 may not appear on the list.
      You can make it visible by holding CTRL+SHIFT (both Windows and
      Macintosh) before you click the down arrow to the right of the
      Style box.

      If you are applying styles by using the Format Styles menu, be
      sure that All Styles is selected in the List box in the lower-
      left corner.

2. Format the chapter and appendix labeling and numbering:

   a. From the Format menu, choose Heading Numbering.

   b. From the Heading Numbering dialog box, select the chapter
      numbering format you want to use. In this example, we have
      selected "Chapter 1".

   c. Choose the Modify button.

   d. In the Modify Heading Numbering dialog box, with Level 1
      appearing in the Level box (the box below the Help button),
      select the formats you want to use from the Number Format boxes.
      In this example, we have replaced the space in the Text After
      box with a colon followed by a space (": ").

   e. In the Level box, scroll down to Level 9. In the Text Before
      box, type "Appendix " (with a space after the word "Appendix").
      In the Bullet Or Number box, select the numbering style you want
      to use (in this example, we have selected A, B, C, ...). In the
      Text After box, replace the space with a colon followed by a
      space.

   f. When you are satisfied with the results in the Preview box,
      choose OK.

3. To number the pages in your document without special formatting, choose
   Page Numbers from the Insert menu, indicate the position and alignment,
   and choose OK. The following procedure shows how to include chapter and
   appendix numbers in the page numbering (for example, "1-1") and restart
   at page number 1 at the beginning of each chapter and appendix. This
   procedure assumes that your document does not yet include section breaks
   or page breaks to distinguish chapters and appendixes.

   a. To automatically number the chapter pages:

      1) Place the insertion point at the beginning of the first
         chapter.

      2) If your document contains text before the start of Chapter 1,
         choose Break from the Insert menu. Under Section Break,
         select Next Page.

      3) Do not move the insertion point. It should be located in the
         section that begins with Chapter 1. From the Insert menu,
         choose Page Numbers.

      4) Choose the Format button.

      5) Choose the Number Format style you want (this example uses
         "1, 2, 3,..."). Select the Include Chapter Number check box.
         In the Chapter Starts With Style box, select Heading 1.

      6) Under Page Numbering, select the Start At option, and in the
         Start At box, select 1.

      7) Choose OK in the Page Number Format dialog box. Choose OK in
         the Page Numbers dialog box. (To check the result, turn Field
         Codes off, and choose Page Layout from the View menu. Scroll
         to the bottom of the page and near the right margin you
         should see "1-1" displayed.)

      8) Move the insertion point to the beginning of Chapter 2 and
         choose Break from the Insert menu. Under Section Break,
         select Next Page.

      9) Repeat step 8 for each chapter.

   b. To automatically number the appendix pages:

      1) Move the insertion point to the beginning of Appendix A and
         choose Break from the Insert menu. Under Section Break,
         select Next Page.

      2) From the Insert menu, choose Page Numbers.

      3) Choose the Format button.

      4) Choose the Number Format style you want (this example uses
         "1, 2, 3,..."). Select the Include Chapter Number check box.
         In the Chapter Starts With Style box, select Heading 9.

      5) Under Page Numbering, select the Start At option, and in the
         Start At box, select 1.

      6) Choose OK in the Page Number Format dialog box. Choose OK in
         the Page Numbers dialog box.

      7) Move the insertion point to the beginning of Appendix B and
         choose Break from the Insert menu. Under Section Break,
         select Next Page.

      8) Repeat step 7 for each appendix. (To check the result, turn
         Field Codes off, and choose Page Layout from the View menu.
         The page number will be displayed near the right margin at
         the bottom of the page.)

4. Build the table of contents:

   a. Place the insertion point at the desired location for the table
      of contents.

   b. From the Insert menu, choose Index And Tables.

   c. Select the Table Of Contents tab.

   d. In the Show Levels box, select the highest number of heading
      styles you want shown in the table of contents, not including
      Heading 9 (the appendixes). (Choose other formatting options as
      desired.)

   e. Choose the Options button.

   f. Under Build Table Of Contents From, select the Styles box.
      Scroll down the Available Styles list to Heading 9; and in the
      TOC Level box to the right, type 1. This instructs Word to
      consider Heading 9 (the appendix headings) to be a level 1 entry
      in the table of contents.

   g. Choose OK in the Table Of Contents Options dialog box.

   h. Choose OK in the Index And Tables dialog box.

To modify the character styles and indents of the entries in the table of contents, modify the styles TOC 1, TOC 2, and so forth. The styles TOC 1 through TOC 9 are styles applied automatically by Word to table of contents entries (TOC 1 for level 1, TOC 2 for level 2, and so forth).

For more information about modifying styles, see the "Modifying the Formats of a Style" section in Chapter 9 ("Automatic Formatting and Styles") of the "Microsoft Word User's Guide."

                MICROSOFT WORD VERSION 2.0 FOR WINDOWS
                =======================================

METHOD 1: BUILDING A TABLE OF CONTENTS WITH HEADING STYLES

Mark the most important text in the document with Heading 1 style. In this Application Note, the sections titled "Introduction," "Microsoft Word Version 6.0," "Microsoft Word Version 2.0 for Windows," and "Troubleshooting Problems" are all marked with Heading 1 style. Mark the next-most important text with Heading 2 style. In this section, "Method 1," "Method 2," and "Using Shortcut Keys to Speed Work" are some of the sections we have marked with Heading 2 style. When you build the table of contents, text marked with Heading 1 style will appear at the left edge of the table of contents, text marked with Heading 2 style will be indented about .25 inch, text marked with Heading 3 style will be indented about .5 inch, and so on. You can change the indents by formatting the table of contents. (This is explained in the "Formatting the Table of Contents" section of this article.)

Step 1: Mark the Text You Want in Your Table

To mark text using the keyboard

1. Place the insertion point on the text you want to include in the table

   of contents.

2. From the Format menu, choose Style.

3. In the Styles list, choose Heading 1.

4. Choose Apply.

To mark text using the mouse

1. Place the insertion point on the text you want to include in the table

   of contents.

2. On the Formatting toolbar, click the down arrow of the Style list.

3. Select Heading 1.

Step 2: Build a Table of Contents with Heading Styles

1. Place the insertion point where you want the table of contents to

   appear.

2. From the Insert menu, choose Table Of Contents.

3. Select Use Heading Paragraphs.

4. Choose OK.

METHOD 2: BUILDING A TABLE OF CONTENTS WITH FIELD CODES

Step 1: Mark the Text You Want in Your Table

1. Place the insertion point next to the text that you want to appear in

   the table of contents.

2. From the Insert menu, choose Field.

3. In the Insert Field Type list, select TC.

4. Move to the Field Code list and place the insertion point to the right

   of the space following "TC".

5. If the text of the entry includes only one word, type that word. If the
   text includes more than one word, enclose the text in quotation marks.
   For example:

      {tc ''Rate of Growth''}

6. If you want the entry to be a different level than a first-level table
   entry, add a level switch by typing a space, the level switch (\L), and
   the level number (1-9) you want to designate. For example:

      { tc ''Rate of Growth'' \L 3 }

7. Choose OK.

Step 2: Build a Table of Contents with TC Fields

1. Place the insertion point where you want the table of contents to

   appear.

2. From the Insert menu, choose Table Of Contents.

3. Select Use Table Entry Fields.

4. Choose OK.

USING SHORTCUT KEYS TO SPEED WORK

There are several keystrokes you can use to quickly update the table of contents or to apply heading styles to paragraphs.

   To do this                            Use this key
   --------------------------------------------------

   Promote a paragraph (change from      ALT+SHIFT+LEFT ARROW
   Normal style to Heading 1 style, from
   Heading 1 to Heading 2, and so forth)
   Demote a paragraph (reverses the      ALT+SHIFT+RIGHT ARROW
   previous process)
   Apply the Normal style                ALT+SHIFT+5 (on the numeric
                                         keypad with NUM LOCK on)
   Insert field braces                   CTRL+F9
   Update selected fields                F9
   Normal view: switch between one field SHIFT+F9
   and its result
   Page layout view: switch between all
   fields and their results
   Unlink a field                        CTRL+SHIFT+F9
   Go to the next field                  F11
   Go to the previous field              SHIFT+F11
   Lock a field                          CTRL+F11
   Unlock a field                        CTRL+SHIFT+F11

USING MULTIPLE TABLES OF CONTENTS

Table of Figures and Other Collections

In Word version 2.0, you can mark figures, photographs, tables, and anything else for inclusion in separate tables of contents. You can use either heading styles or fields to mark these elements. Use unused heading styles to quickly mark the items. If your document doesn't contain any unused heading styles, you'll need to use fields.

To create multiple tables of contents using heading styles

To mark the headings you want to include in the various tables, assign a different heading style to each group. For example, use Heading 1 through Heading 6 to format the normal table of contents entries, use Heading 7 for the titles of tables, use Heading 8 for the titles of photos, and use Heading 9 for figures. To create the separate tables of contents, create a separate TOC field for each heading level.

Create each separate table of contents by doing the following. Repeat the procedure for each table you want to include.

1. Mark the text as in "Method 1: Building a Table of Contents with Heading

   Styles." Use a heading style that isn't used anywhere else in the
   document.

2. Place the insertion point where you want the table of contents to
   appear.

3. From the Insert menu, choose Table Of Contents.

4. Select Use Heading Paragraphs.

5. Select From.

6. In the From box, select the heading level you used in step 1.

7. In the To box, select the heading level you used in step 1.

8. Choose OK.

To create multiple tables of contents using TC fields

Choose a list identifier for each type of table. For example, you might use the letter "t" for tables, "p" for photos, and so on. Word reserves the letter "c" as the default for an ordinary table of contents, so you should not use "c" for any other type of list.

To insert the field code:

1. Place the insertion point next to the text that you want to appear in

   the table.

2. From the Insert menu, choose Field.

3. In the Insert Field Code list, select TC.

4. Move to the Field Code list.

5. If the text of the entry includes only one word, type that word. If the

   text includes more than one word, surround the text with quotation
   marks. For example:

      { tc ''Rate of Growth'' }

6. To identify the type of table, add a field switch by typing a space, the
   field switch (\F), and the list identifier you chose. For example, if
   you are marking a photo and want to designate "p" as the list identifier
   for the items to be included in the table of photos, your field should
   look like this:

      { tc ''Montana Sunset'' \f p }

7. If you want the entry to be a different level than a first-level table
   entry, add a level switch by typing a space, the level switch (\L), and
   the level number (1-9) you want to designate. For example:

      { tc ''Montana Sunset'' \f p \L 3 }

   If you include both the \L and \F switches, always place the \L switch
   after the \F switch.

8. Choose OK.

To build the table for lists created using fields

1. Place the insertion point where you want the table to appear.

2. From the Insert menu, choose Fields.

3. In the Insert Field Type list, select TOC.

4. In the Instructions list, select Field entries.

5. Choose Add.

6. Move the insertion point to the end of the existing text in the Field

   Code box and type a space, then type the letter you used when marking
   the text. For example, if you used the letter "p" when marking photos,
   the Field Code box for the table of pictures will show:

      { TOC \f p }

7. Choose OK.

Creating a Table of Contents in a Separate Document

Reference Document (RD) fields allow you to create a document that consists only of a table of contents or an index. This can be useful if the chapters of the document are in separate files and you want to keep them separate for organizational or size purposes.

To create a document that consists only of a table of contents

 1. Start a new document.

 2. Display hidden text by clicking the Show/Hide button.

 3. Display field codes by choosing Field Codes from the View  menu.

 4. From the Insert menu, choose Field.

 5. From the Field Types list, select Referenced Doc.

 6. Click in the Field Codes box.

 7. Type the filename of the first document you want to include
    in the table of contents.

    NOTE: If you are typing a full path, you must type each backslash
    twice. For example, if the file is named INTRO.DOC and is located  in
    the C:\WINWORD directory, you must type C:\\WINWORD\\INTRO.DOC  in the
    Field Codes box. If the table of contents document and the  INTRO.DOC
    are in the same directory, you do not need to include a  full path.

 8. Choose OK.

 9. Repeat steps 4-8 for each document that contains text you
    want to include in the table of contents.

10. Build the table of contents by following the steps described in
    "Step 2: Build a Table of Contents with Heading Styles"  or "Step
    2: Build a Table of Contents with TC Fields".

FORMATTING THE TABLE OF CONTENTS

When you create a table of contents, Word automatically applies a standard style to each entry. Word formats first-level entries with the style TOC 1, second-level entries with TOC 2, third-level entries with TOC 3, and so on. These standard TOC styles are built in to Word and have preset formats (for example, each level is indented by .25 inch). You can change how the table of contents looks by modifying these styles.

For information about modifying standard styles, see the "Using the Standard Styles in Word" section in Chapter 8 ("Formatting with Styles") of the Microsoft "Word for Windows User's Guide".

SWITCHING FROM WORDPERFECT

Creating a table of contents in Word 2.0 is similar to creating one in WordPerfect. In WordPerfect, creating a table of contents consists of three steps: marking text, defining the table of contents, and generating the table of contents. In Microsoft Word, there are only two steps: marking text and building the table of contents.

How Word 2.0 and WordPerfect Differ

The way in which Word marks the text for the table of contents is different from WordPerfect's method. In WordPerfect, a code appears at the beginning of text which is to be included, and a code appears at the end. These codes are visible when Reveal Codes is turned on. In Microsoft Word, you can mark the text by applying a certain style to it, or you can place a copy of the text to be included in a field.

Converting Existing WordPerfect Documents

All table of contents entries convert as TC fields, with all the correct level information.

USING CHAPTER AND HEADING NUMBERING

In Word version 2.0 for Windows you can use SEQ (sequence) fields to create "chapter-page" numbering in the document; this numbering can also be used in a table of contents. For example, you can use a SEQ field to insert 2-1 as the page number on page 1 of Chapter 2, and the table of contents will show 2-1 as the page number.

The SEQ field is a counter. The first SEQ field appears as the number "1," the second shows the number "2," and so on. For more information on SEQ fields, search in Word Help for the word "sequence."

1. Create chapter numbering:

   a. Place the insertion point at the beginning of the first chapter.

   b. From the Insert menu, choose Fields.

   c. Select Sequence.

   d. Move the insertion point to the Field Code box.

   e. After the word SEQ, type a space and the word "chapter". For
      example:

         { seq chapter }

      NOTE: If you do not want the chapter number to appear in the
      document, add a space and the \h switch after the word
      "chapter".

   f. Choose OK.

   g. Repeat these steps for each chapter.

2. To include the chapter number in the table of contents:

   a. Place the insertion point where you want the table of contents
      to appear.

   b. From the Insert menu, choose Table Of Contents.

   c. Select either Use Heading Paragraphs or Use Table Entry Fields,
      depending on which method you used.

   d. Choose OK.

      The table of contents is inserted but does not include chapter
      numbers.

   e. Move the insertion point within the table of contents.

   f. Press SHIFT+F9 to show the field code.

   g. Move the insertion point to the left of the right-most field
      brace, type a space, and type \S and "chapter". For example,
      if you are using heading paragraphs, the field code will look as
      follows:

         { toc \o \s chapter }

      If you are using table entry fields, the field code will look
      like this:

         { toc \f \s chapter }

   h. Press SHIFT+F9 to toggle the display of the field code.

   i. Press F9 to update the table of contents.

3. To include the chapter number in the header or footer:

   a. From the View menu, choose Page Layout.

   b. Place the insertion point in the header or footer.

   c. From the Insert menu, choose Field.

   d. From the Insert Field Type list, select Sequence.

   e. Move the insertion point to the Field Code box.

   f. After the word SEQ, type a space, the word "chapter," a space,
      and the \C switch. For example:

         { seq chapter \c }

      The \C switch instructs Word to insert the nearest preceding
      sequence number-- that is, the current number.

   g. Choose OK.

           TROUBLESHOOTING PROBLEMS IN WORD 2.0 AND WORD 6.0
          ==================================================

PAGE NUMBERS ARE WRONG

THE TC FIELDS ARE MISSING

TC fields are automatically formatted with Hidden text attributes. To display them, click the Show/Hide button.

Field Codes Are Printed Instead of

the Table of Contents or Page Numbers

If the field codes in the document are printed instead of their results, you need to turn off that option. From the Tools menu, choose Options. Select the Print category. Clear the Field Codes option. Choose OK.

FIELD CODES SHOW IN THE DOCUMENT

In Word 6.0, turn off display of field codes by choosing Options from the Tools menu, selecting the View tab, and clearing the Field Codes check box. Or, press ALT+F9. To view an individual field code, place the insertion point within the field result and press SHIFT+F9.

In Word 2.0, turn off display of field codes by choosing Field Codes from the View menu. Or, press ALT+F9. To view an individual field code, place the insertion point within the field result and press SHIFT+F9.

ERROR MESSAGES

"Word found no paragraphs with heading

styles to include in the table of contents."

This message will appear if you try to insert a table of contents based on text marked with heading styles, but you have not used heading styles in the document. You must first mark the text that you want included with heading styles or with field codes. Insert the table of contents after marking the text.

"Error! No table of contents entries found."

You have opted to build a table of contents from field codes, but there are none in the document. Insert the field codes in the document before you insert the table of contents.

"Do you want to replace the selected table of contents?"

This message appears when you insert a table of contents through the menu and you already have an existing table of contents in the document. If you are merely updating the table of contents, choose Yes. If you want to insert an additional table of contents, such as a separate table of figures, choose No. The additional table will be inserted where the insertion point is.

"Error! Bookmark not defined" prints instead of page number.

The document needs to be updated. The fastest way to do this is to select the entire document by choosing Select All from the Edit menu, and then pressing F9 to update all fields in the document.

                              <End of XD1033>

TO OBTAIN THIS APPLICATION NOTE

The following file is available for download from the Microsoft Software Library:

 ~ XD1033.EXE (size: 109782 bytes) 
              (Windows)

 -or-

~ XD1033.HQX (Macintosh)

For more information about downloading files from the Microsoft Software Library, please see the following article in the Microsoft Knowledge Base:

   ARTICLE-ID: Q119591
   TITLE     : How to Obtain Microsoft Support Files from Online Services
Keywords          : kbtshoot kbfield macword word6 word7 word95 kbhowto 
Version           : WINDOWS:2.0,2.0a,2.0a-CD,2.0c,6.0; MACINTOSH:6.0, 6.0.1;
Platform          : MACINTOSH WINDOWS

Last Reviewed: December 31, 1998