Creating Many Index Entries at Once

by Allen Wyatt
(last updated September 14, 2019)


Justin is putting together a document that has many references that look like "ABC 12:34," and he wants to create index entries for all of them. He is able to use wildcards in Find and Replace to find these references, but he has not been able to find a way to create an index entry for each instance that is found.

One way to create the index you want is to rely on what Microsoft calls a "concordance file." This is nothing but a list of things you want indexed and an indication of how you want them indexed. Word then uses the concordance file as a guide in adding the index entries to your main document.

Let's look at the concordance file first. It is very simply constructed, containing nothing but a single two-column table. In the left column, each row should indicate a different term you want indexed in your main document. In Justin's case, he would need to list each unique "ABC 12:34" combination. In the right column each row would contain the index entry desired for the term to the left. In many cases this may mean that the right column simply repeats what is in the left, but it wouldn't necessarily if you want to specify different wording for the index entry or you want a subentry included. (If you want a subentry, you would use the main index entry followed by a colon and then the subentry.)

Once the concordance file is complete, save it away. Now you can open your main document and follow these steps:

  1. Display the References tab of the ribbon.
  2. Near the right side of the ribbon, in the Index group, click the Insert Index tool. Word displays the Index dialog box. (See Figure 1.)
  3. Figure 1. The Index dialog box.

  4. Click the AutoMark button. Word displays a dialog box that looks very similar to a standard Open dialog box.
  5. Use the tools in the dialog box to locate and select the concordance file you created.
  6. Click Open.

That's it; Word uses the contents of the concordance file as the guide for adding index entries to your main document. When it is done, you can insert your index wherever you want.

One thing I find helpful whenever I'm going to let Word perform some sort of mass operation on a document is to actually make sure I keep an extra copy of the document sitting around. Thus, before you apply the concordance file using the steps above, you might want to make a copy of your unaltered document. This is simply a safety precaution in case I, personally, messed something up in the concordance file.

If you don't want to go the route of creating a concordance file, you could use a macro to add the index entries. This is an example:

Sub CreateManyIndexEntries()
    Dim sFindPattern As String
    Dim sTemp As String

    ' Indicate the pattern to find
    sFindPattern = "^$^$^$ ^#^#:^#^#"

    ' Jump to beginning of document
    Selection.HomeKey Unit:=wdStory

    ' Find first instance of pattern
    With Selection.Find
        .Text = sFindPattern
        .Replacement.Text = ""
        .Forward = True
        .Wrap = wdFindStop
        .Format = False
        .MatchCase = False
        .MatchWholeWord = False
        .MatchWildcards = False
        .MatchSoundsLike = False
        .MatchAllWordForms = False
        .IgnoreSpace = False
    End With

    While Selection.Find.Found
        ' Create what we want for index entry,
        ' ensuring that any colons are escaped out
        sTemp = Replace(Selection, ":", "\:")

        ' Create the actual index entry
        ActiveDocument.Indexes.MarkEntry _
          Range:=Selection.Range, _
          Entry:=sTemp, _
          EntryAutoText:="", _
          CrossReference:="", _
          CrossReferenceAutoText:="", _
          BookmarkName:="", _
          Bold:=False, _

        ' Set up next Find operation
        Selection.Collapse wdCollapseEnd
End Sub

The macro jumps to the beginning of the document and finds the first instance of whatever is in the sFindPattern variable. As shown above, the variable contains a pattern—three letters followed by a space, then two digits, a colon, and two digits. (This is the pattern that Justin specified.) If a match is found, then an index entry is created that matches whatever was found. The index entry is inserted in the document and then the next occurrence of the pattern is looked for. This is repeated for each instance of the pattern in the document.

The macro approach is more of a brute-force method of creating the index entries. That's because it isn't as flexible as using the concordance file; it doesn't handle creating index entries that are different from what you are searching for, nor does it handle subentries.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (13674) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Office 365.

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. ...


Using the Address Book

Ways to use the address book when printing envelopes and labels.

Discover More

Quickly Formatting Footers in Documents with Many Sections

Need to adjust all the footers or headers in a document that uses lots of them? It's easy to do if you understand how the ...

Discover More

Getting Pictures Out of Word

If you receive a Word document from someone, you may want to get any graphics it contains into their own files. You can ...

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 (ribbon)

Word Count for a Section

Dynamic word counts for your entire document are easy to get when you use using fields. There is no built-in method to ...

Discover More

Correcting Student Papers

If you are a teacher, you may be looking for ways you can use Word's features to correct papers your students send to you ...

Discover More

Word Count is Zero

If you use the Word Count tool and are surprised that it returns a count of 0, it could be because of what you selected ...

Discover More

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.


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 six more than 4?

2019-09-14 05:05:55

Mike Dresel

This is a great tip. I will definitely be able to use it.

One general comment about "how to do X" instructions. Not everyone reads the entire list before starting, so anything that goes "Step 1; Step 2; Step 3; But first, do this" can be difficult/disasterous. I would recommend that the (very useful) suggestion to back up the document should come before the indexing instructions
Mike - who had written way too many instructions.

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

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.