Microsoft KB Archive/193145

= WD97: How to Have More Than One Index in a Document =

Article ID: 193145

Article Last Modified on 1/23/2007

-

APPLIES TO


 * Microsoft Word 97 Standard Edition

-



This article was previously published under Q193145





SUMMARY
This article describes how to create multiple indexes within one document. You may want to create multiple indexes, for example, when you need to have an index at the end of each section or chapter as well as at the end of your document.



MORE INFORMATION
To create multiple indexes, use one of the following methods:


 * Use Method 1 to index words that you need to include in an index for separate sections in a multiple-section document.
 * Use Method 2 if you do not have a multiple-section document but want to have multiple indexes based on a certain category.

Method 1
Use this method to index words that you need to include in an index for separate sections in a multiple-section document:

 Create a bookmark for each section of the document for which you want to create an index. (NOTE: Omit this step for an index for the entire document.) To create the bookmark:  Select the entire section, and then click Bookmark on the Edit menu. In the Bookmark Name text box, type a name for the bookmark, for example "section1" (without quotation marks), and then click Add. Repeat steps a and b for each section of the document.  Mark the index entries. To do this, follow these steps:  Select the text for which you want to create the index entry.</li> On the Insert menu, click Index And Tables, and then click the Index tab.</li> Click Mark Entry. The text that you selected in step a appears in the Main Entry text box in the Mark Index Entry dialog box. If you want to create a sublevel index entry, type the word or phrase in the Subentry text box. To include a third sublevel, type the subentry text in the Subentry box, followed by a colon, followed by the word or phrase you want to use for the third-level entry. Choose any other options that you want.</li> Click Mark All.

Word examines each paragraph of your document, matching it to the text that you specified in the Main Entry and Subentry boxes, and inserts an XE field immediately following the first occurrence of that word in each paragraph.</li> Click in the document, and select the next word or phrase that you want to index. NOTE: This dialog box is "modeless," which means that while the dialog box is on the screen, you can click in the text area and continue editing.</li> Return focus to the Mark Index Entry dialog box by clicking the dialog box, and then click Mark All.</li> Repeat steps e and f for each word you want to index.</li></ol> </li> Insert the Index Fields.

 Position the insertion point where you want the first index, and then click Field on the Insert menu.</li> In the Categories list box, select Index And Tables. In the Field Names list box, choose Index.</li> Click Options.</li> In the Switches list box, select the \b switch, and then click Add to Field. The \b switch specifies an area of the document for which you created a bookmark. (See step 1.)</li> In the Field Codes text box, position the insertion point after the \b and type the name of the bookmark that you created in step 1. For example, if you created a bookmark for the first section called "Section1" (without quotation marks) the Field Codes text box should resemble the following:

Index \b section1

</li> Repeat steps a through e for each of the remaining sections of the document.</li></ol>

To add an index at the end of the document, position the insertion point where you want to build the index, click Index And Tables on the Insert menu, click the Index tab, and then click OK.</li></ol>

Method 2
Use this method if you do not have a multiple-section document but want to have multiple indexes based on a certain category:

<ol> <li>Mark the index entries. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> <li>Select the text for which you want to create the index entry.</li> <li>On the Insert menu, click Index and Tables, and then click the Index tab.</li> <li>Click Mark Entry. The text that you selected in step a appears in the Main Entry text box in the Mark Index Entry dialog box. If you want to create a sublevel index entry, type the word or phrase in the Subentry text box. To include a third sublevel, type the subentry text in the Subentry box, followed by a colon, followed by the word or phrase that you want to use for the third-level entry. Choose any other options that you want.</li> <li>Click Mark All. Word examines each paragraph of your document, matching it to the text that you specified in the Main Entry and Subentry boxes, and inserts an XE field immediately following the first occurrence of that word in each paragraph.</li> <li>Click in the document, and select the next word or phrase that you want to index. NOTE: This dialog box is "modeless," which means that while the dialog box is on the screen, you can click in the text area and continue editing.</li> <li>Return focus to the Mark Index Entry dialog box by clicking the dialog box, and then click Mark All.</li> <li>Repeat steps e and f for each word that you want to index.</li></ol> </li> <li>You will need to manually edit the index entry fields to specify in which index you want the entry to appear. The \f switch defines an entry type. For example, the entry for the field { XE "Selecting Text" \f "a"} is included only in an index inserted by the field { INDEX \f "a" }. The default entry type is "i." <ol style="list-style-type: lower-alpha;"> <li>View field codes by pressing ALT+F9.</li> <li>Each index entry field that you want to include in a specific index will need to be marked with an identifying letter. For example all index entries that you want to appear in Index "a" will be marked as:

{ XE "Selecting Text" \f "a"}

All index entries that you want to appear in Index "b" will be marked as:

{ XE "Selecting Text" \f "b"}

</li></ol> </li> <li>Insert the Index Fields. <ol style="list-style-type: lower-alpha;"> <li>Position the insertion point where you want the first index, and then click Field on the Insert menu.</li> <li>In the Categories list box, select Index And Tables. In the Field Names list box, select Index.</li> <li>Click Options.</li> <li>In the Switches list box, select the \f switch, and then click Add To Field. The \f switch defines the entry type.</li> <li>In the Field Codes text box, position the insertion point after the \f and type the letter that represents the category that you created in step 1. For example:

{ Index \f "a"}

</li> <li>Repeat steps a through e for each index you want to create in each category.</li></ol> </li></ol>

For additional information, please see the following article in the Microsoft Knowledge Base:

125937 How to Create a Table of Contents or an Index with Field Codes

Additional query words: many several more 8.0 8.00

Keywords: kbhowto KB193145

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.