Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, 2013, and 2016. If you are using an earlier version (Word 2003 or earlier), this tip may not work for you. For a version of this tip written specifically for earlier versions of Word, click here: Multiple Indexes in a Document.

Multiple Indexes in a Document

by Allen Wyatt
(last updated February 4, 2017)

3

Marc has a multi-sectioned document. He wants to create an index on one section and a second index for the entire document. Marc wonders if there is a way to have two indexes in a document where one of them covers only a single section.

The short answer is yes, there is a way. When you insert an index into a document, what you are actually doing is inserting the INDEX field. With no switches used in the field, Word creates an index based on the entire document. To create an index based on only a portion of the document (such as on a single section), follow these general steps:

  1. Select the document section that you want to have indexed in its own special index.
  2. Create a bookmark that applies to the selected text. (Click the Bookmark tool on the Insert tab of the ribbon.) Remember the name you used for the bookmark.
  3. Create the basic INDEX field. (Press Ctrl+F9 to insert field braces and type the word INDEX.)
  4. After the word INDEX, type a space, \b (to indicate that this index will apply to only a bookmarked area of the text), another space, and the name of the bookmark you created in step 2. Your entire field should look something like this:
  5. { INDEX \b MySection }
    
  6. Press F9 to collapse the field and create your index.

There is another way to approach the problem, as well: You could add a switch to the XE field that is used to create an index entry. For instance, let's say you are indexing the term "polar bear" for the index. Make sure you have a field near the term like this one:

{ XE "polar bear" \f "a" }

The \f switch should appear only for index entries in the section that you want to have its own index. Later, when you insert the INDEX field to create the index for that section, you should make sure it looks like this:

{ INDEX \f "a" }

The index created by this field will only included those index entries that use the \f switch followed by the letter "a".

Adding the switch to the XE fields is handy, but suppose that you've already created your index entries without using the \f switch. If you want to later add the \f switch to the XE fields in the section, you can do it by following these steps:

  1. Type \f "a" (note the space in there) in a blank spot of your document and then cut it to the Clipboard.
  2. Make sure that field codes are displayed in your document. (Press Alt+F9 to either show or hide the field codes.)
  3. Select all the text in the section that will have its own index.
  4. Press Ctrl+H to display the Replace tab of the Find and Replace dialog box.
  5. In the Find box, type XE "*"
  6. In the Replace box, type ^&, a space, and then ^c. The ^& will replace what is found with itself, then there's a space, and the ^c adds what is on the Clipboard (from Step 1).
  7. Click More and make sure the Use Wildcards checkbox is selected.
  8. Click Replace All. When you're asked if you want to search the rest of the document, answer negatively. (You don't want to search the entire document; you only want to affect the portion you selected in step 3.)

You can find additional information about these steps in the Microsoft Knowledge Base:

http://support.microsoft.com/?kbid=154025

Even though the Knowledge Base article is for much older versions of Word, it will still work with your version because the behavior of the index-related fields it uses has not changed since the earliest versions of Word.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (12137) applies to Microsoft Word 2007, 2010, 2013, and 2016. You can find a version of this tip for the older menu interface of Word here: Multiple Indexes in a Document.

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

Excel 2007 Filters and Filtering (Table of Contents)

Excel provides two ways to filter your data so that only what you want to see is displayed. Discover how filtering works ...

Discover More

Item Not Available in Library

When sharing workbooks with others, you may find that the macros in those workbooks may not work as you expect. This tip ...

Discover More

Inserting Text with a Macro

Need to have your macro insert a bit of text into your document? It's easy to do using the TypeText method.

Discover More

The First and Last Word on Word! Bestselling For Dummies author Dan Gookin puts his usual fun and friendly candor back to work to show you how to navigate Word 2013. Spend more time working and less time trying to figure it all out! Check out Word 2013 For Dummies today!

More WordTips (ribbon)

Indexing a Range of Pages

After you get your document ready for indexing by inserting index fields throughout it, you may want to index only a ...

Discover More

Adding Hyperlinks to an Index

Word provides a full set of tools you can use to generate an index for your document. One thing you can't do, however, is ...

Discover More

Specifying a Collating Sequence for Indexes

The indexing feature provided by Word can be a great help, but in some situations it may not sort your index as 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}] 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 2 - 1?

2019-02-18 20:25:03

Grace Michael

Hello, Allen ... I have read and done everything that you say in your post about creating Multiple Indexes in a document. However, I cannot find a way to get word to create one Index one index over another (one set of \f switchedover another). Example: If one \f indexes People's Names, and another \f indexes Topics how do I get word to create the separate indexes? Word will create the first index that I create (\f People's names), but not the second index (\f Topics). I have both Word 2010 and Word 2016 on different computers. In the Reference tab, in the Index section, when I click "Insert Index," I have no option to tell Word which Index I want - People's names or Topics. I have researched the web, and instructions about using the \f switch are numerous, but I cannot find a way (except in an older version of Word which I don't have) that will let me select which Index I want created. Can you tell me what I am missing or what I need to do (and/or how) so I can tell Word which Index to create? Thank you for any help you can give me.
Grace
Grace Michael


2018-12-12 20:37:40

Delma Sweeney

Hi Allen
The Microsoft link in this article does not work.
Cheers


2017-02-06 13:33:32

Jessica Davis

You can also use this tip for building chapter level Tables of Contents, using the TOC field. This is a very useful tip for me. Thank you!


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.