WD: XD1033: How to Create a Table of Contents in WordLast reviewed: November 17, 1997Article ID: Q127249 |
The information in this article applies to:
SUMMARYMicrosoft 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. You can obtain this Application Note from the following sources:
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 IncludedThe 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, 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 CONTENTSEntries 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 STYLESMark 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 TableTo mark text using the menu
Step 2: Build a Table of Contents with Heading Styles
Building a Table of Contents with Other Styles
METHOD 2: BUILDING A TABLE OF CONTENTS WITH FIELD CODES
Step 1: Mark the Text You Want in Your TableUse 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:
Step 2: Build a Table of Contents with TC Fields
METHOD 3: BUILDING A TABLE OF CONTENTS WITH BOTH STYLES AND FIELDSMark 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:
USING SHORTCUT KEYS TO SPEED WORKThere 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 boxCREATING 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:
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.
{ 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 CONTENTSWhen 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 WORDPERFECTCreating 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 DifferWord'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 DocumentsWhen 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:
SUPPRESSING PAGE NUMBERSWord 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:
INCLUDING CHAPTER NUMBERINGUsing 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.
INCLUDING CHAPTER AND APPENDIX HEADINGS IN THE TABLE OF CONTENTSThe 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:
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 STYLESMark 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 TableTo mark text using the keyboard
Step 2: Build a Table of Contents with Heading Styles
METHOD 2: BUILDING A TABLE OF CONTENTS WITH FIELD CODES
Step 1: Mark the Text You Want in Your Table
Step 2: Build a Table of Contents with TC Fields
USING SHORTCUT KEYS TO SPEED WORKThere 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 CollectionsIn 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 stylesTo 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.
To create multiple tables of contents using TC fieldsChoose 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:
To build the table for lists created using fields
Creating a Table of Contents in a Separate DocumentReference 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
FORMATTING THE TABLE OF CONTENTSWhen 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 WORDPERFECTCreating 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 DifferThe 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 DocumentsAll table of contents entries convert as TC fields, with all the correct level information.
USING CHAPTER AND HEADING NUMBERINGIn 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."
PAGE NUMBERS ARE WRONG
THE TC FIELDS ARE MISSINGTC 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 NumbersIf 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 DOCUMENTIn 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 NOTEThe 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 : kbfield kbhowto macword word6 word7 word95 kbtshoot Version : WINDOWS:2.0,2.0a,2.0a-CD,2.0c,6.0; MACINTOSH:6.0, 6.0.1; Platform : MACINTOSH WINDOWS Issue type : kbappnote |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |