Please Note: This article is written for users of the following Microsoft Word versions: 97, 2000, 2002, and 2003. If you are using a later version (Word 2007 or later), this tip may not work for you. For a version of this tip written specifically for later versions of Word, click here: Putting Bold Words in an Index.

Putting Bold Words in an Index

Written by Allen Wyatt (last updated October 12, 2019)
This tip applies to Word 97, 2000, 2002, and 2003


1

Mori has a document that has "keywords" listed in boldface. He would like to create an index that includes these keywords. Mori wonders if there is a way to automatically mark all the bold phrases so they will appear in an index.

There are a couple of ways you can approach this task. Perhaps the easiest way is to take advantage of Word's AutoMark capability to create your index entries. The trick is to get your words—the ones you want into an index—into their own file. Here's an easy way to do that:

  1. Open the document for which you want the index.
  2. Create a new, blank document.
  3. Switch back to your source document (the one for which you want the index).
  4. Press Ctrl+F. Word displays the Find tab of the Find and Replace dialog box. (See Figure 1.)
  5. Figure 1. The Find tab of the Find and Replace dialog box.

  6. Make sure that the Find What box is empty and that the insertion point is in it.
  7. Press Ctrl+B. Word indicates that you want to find bold text.
  8. Select the Highlight All Items Found check box.
  9. Click Find All. Word highlights all the words in the document that are bold.
  10. Press Ctrl+C. All the words are copied to the Clipboard.
  11. Switch to the blank document.
  12. Press Ctrl+V. All the words are now in the previously blank document, one word per line.

With the words in their own document, you can easily sort them and look for any duplicates. Get rid of the duplicates so that you have a list of unique words and phrases, one per line. You then need to convert the words to a table; just select them and choose Table | Convert | Text to Table. What you should end up with is a table that has a single column with your words and phrases in that column. (If you end up with multiple columns, you may want to undo the conversion and look for any Tab characters in the list of words and phrases. If you find them, delete them, as they trigger the conversion to add another column.)

With all your words and phrases in a single column, add a second column just to the right of the first one. For the AutoMark feature to work best, the first column needs to contain the words or phrases you want marked in the document and the second column needs to contain how you want those words and phrases to appear in the index.

For instance, you might have multiple variations of the same phrase in the first column, such as "tallied results," "tally results," "tallied responses," and "tally responses." If you want each of these to appear in the index under the phrase "tallying results," then you would place that phrase to the right of each of the original phrases. If you want the word or phrase in the left column to be the same word or phrase used in the index, then just copy it from the left column to the right column.

When you are done with your list, save the document. You can then use what you've created to AutoMark the original document, in this manner:

  1. Choose Insert | Reference | Index and Tables. Word displays the Index and Tables dialog box.
  2. Make sure the Index tab is displayed. (See Figure 2.)
  3. Figure 2. The Index tab of the Index and Tables dialog box.

  4. Click on the AutoMark button. Word displays the Choose a File dialog box.
  5. Use the controls in the dialog box to select the file that contains your list of keywords and phrases.
  6. Click Open.

That's it. Word uses your list of words as a "roadmap" to what it should mark in your document. When the AutoMark feature is done, you can then create your index as you desire.

If you prefer, you can use a macro to mark all the index entries in your document, based on whether the text is bold or not. The following example simply searches through a document for any bold text. If it locates that text, then it inserts an index entry there.

Sub InsertingIndexEntries()
    Application.ScreenUpdating = False

    'Go to the first page of the document
    Selection.HomeKey wdStory, wdMove

    'Set up the Find and Replace operation
    Selection.Find.ClearFormatting
    Selection.Find.Replacement.ClearFormatting
    With Selection.Find
        .Text = ""
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindContinue
        .Format = True
        .MatchWildcards = False
        .Font.Bold = True
    End With

    'Finds the bold text and inserts an index entry.
    Do
        Selection.Find.Execute
        If Selection.Find.Found Then
            'Checks if the Index field was selected
            'This occurs if it does not contain any entries
            If UCase(Selection.Range.Text) <> "NO INDEX ENTRIES FOUND." Then
                'Insert an index entry and use the text within
                'the selected range as the entry name
                ActiveDocument.Indexes.MarkEntry _
                  Range:=Selection.Range, _
                  Entry:=Selection.Range.Text, _
                  EntryAutoText:=Selection.Range.Text, _
                  CrossReference:="", _
                  CrossReferenceAutoText:="", _
                  BookmarkName:="", _
                  Bold:=False, _
                  Italic:=False, _
                  Reading:=""
                'Move past text that was found and the new index entry
                Selection.MoveRight wdCharacter, 1, wdExtend
                Selection.Collapse wdCollapseEnd
            End If
        End If
    Loop While Selection.Find.Found

    Application.ScreenUpdating = True
    Application.ScreenRefresh
End Sub

Remember that this macro finds any and all bold text in the document, including (possibly) places you may not expect. For instance, if you have some headings that are formatted as bold, those headings will be marked for the index, as well. Further, if you run the macro more than once, you may end up with multiple index entries for each bolded phrase or word. If you need to run it more than once, get rid of the existing index fields before you run it again.

Note:

If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (1) applies to Microsoft Word 97, 2000, 2002, and 2003. You can find a version of this tip for the ribbon interface of Word (Word 2007 and later) here: Putting Bold Words in an Index.

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

Incomplete and Corrupt Sorting

Using the sorting tools, on the toolbar, may result in some unwanted results, such as jumbled data. If this happens to ...

Discover More

Controlling Where a Full-page Border is Printed

When you add full-page borders to your document, you may be bothered to find out that one or more sides of the border ...

Discover More

Unlocking a Worksheet with an Unknown Password

It is not unusual, in a corporate world, to be handed a worksheet whose source you don't know. If that worksheet is ...

Discover More

Do More in Less Time! Are you ready to harness the full power of Word 2013 to create professional documents? In this comprehensive guide you'll learn the skills and techniques for efficiently building the documents you need for your professional and your personal life. Check out Word 2013 In Depth today!

More WordTips (menu)

Specifying an Index Entry Separator

One of the switches you can use with the index field allows you to specify how index entries should be separated from the ...

Discover More

Including Section Numbers in an Index

When you use Word to create your index, you'll normally only include a page number in the index. If you want to create an ...

Discover More

Creating an Index Entry for a Range of Pages

Putting together an index for your documents can be challenging, but Word provides some great tools to make the task ...

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 one less than 9?

2023-08-02 12:39:53

Stephen

Thank you so much, Allen: this post saved me an enormous amount of time!


This Site

Got a version of Word that uses the menu interface (Word 97, Word 2000, Word 2002, or Word 2003)? This site is for you! If you use a later version of Word, visit our WordTips site focusing on the ribbon 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.