Please Note: This article is written for users of the following Microsoft Word versions: 2007, 2010, and 2013. 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: Including Section Numbers in an Index.

Including Section Numbers in an Index

by Allen Wyatt
(last updated February 22, 2014)

3

Word allows you to create dynamic indexes for your documents. These indexes can be generated, as needed, to reflect changes in page numbers within the document. The simplest of indexes contain only page numbers for the items being indexed. You may, however, want to create an index that also includes section numbers for entries.

There are two ways you can approach putting section numbers in an index. The easiest way is if the sections are just that—sections of your Word document, separated by section breaks. In this case, you can use compound fields so your index entries look something like this:

{XE "My Index Entry" \t "{SECTION}:{PAGE}"}

In this case you are using the \t switch to indicate that you want Word to substitute the text following the switch for the actual page number. Normally the \t switch is used for cross-references, but in this instance you are telling word to substitute the section number (generated by the SECTION field) followed by a colon and the page number (generated by the PAGE field). If you use this XE field to mark an index entry on page 6 of section 2, then the generated index will look like this:

My Index Entry. 2:6

The other method of including section numbers in your index comes in handy if your "sections" do not correspond to actual Word document sections. In this instance you use a different INDEX field to actually generate your index:

{INDEX \s MySection \d ":"}

The \s switch tells Word that you want the page numbers in the index to include the sequence number designated by the term following. In this instance, the entries in the index will include the number associated with the MySection sequence, followed by the character specified by the \d switch (a colon), and the page number. The sequence, of course, is set within the document by using the SEQ field:

{SEQ MySection}

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (9138) applies to Microsoft Word 2007, 2010, and 2013. You can find a version of this tip for the older menu interface of Word here: Including Section Numbers 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

Unwanted Read-Only Workbook Status

Once a workbook assumes a "read-only" status, it can be a real pain to get that status removed. This tip explains why and ...

Discover More

Creating Tables with Specific Column Widths

Create a table and Word figures out column widths by dividing the horizontal space by the number of columns you want in the ...

Discover More

Using Find and Replace to Change Text Case

Can you really use Find and Replace to change the case of text in your document? Not really, but that shouldn't stop you from ...

Discover More

Create Custom Apps with VBA! Discover how to extend the capabilities of Office 2013 (Word, Excel, PowerPoint, Outlook, and Access) with VBA programming, using it for writing macros, automating Office applications, and creating custom applications. Check out Mastering VBA for Office 2013 today!

More WordTips (ribbon)

Using Subentries in an AutoMark File

If you have a large document and need to create a complicated index, an AutoMark file can make your life much easier. This ...

Discover More

Deleting Index Entries

When you construct an index you need to insert all sorts of index fields throughout your document. If you want to later ...

Discover More

Specifying Index Section Dividers

When adding an index to your document, you can use one of the available field switches to specify how the index should be ...

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 8Mpixels. 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 5 + 0?

2017-08-15 00:23:43

Madonna Cullinan

Hi,

Thanks for this helpful post. I have just subscribed to your newsletter and am excited about having some online buddies in this precarious area of Indexing in Word 2013 :) I have a quick question please regarding above. I am wanting to display in my index - Topic........subsection....page number
something like : topic....10.2 (b).............4

I thnk I will need to create a separate section break in between each section i.e. btwn 10.1 10.2 etc...

Any ideas on this?
Thank you
Madonna


2015-04-18 23:51:33

K Miller

Problem #1
I tried the {XE "My Index Entry" t "{SECTION}:{PAGE}"} method and finally got it to work when I used the insert field tools instead of typing the code. However, the page number generated is for the pagination with the hidden text/field codes visible. In a document with several long index markers and field codes, this creates wrong page numbers after page 2. I know of no way to update the internal page number field once the XE index entry field is hidden.

Problem #2
I there a way to create an index that uses and Section or Chapter Title--instead of a chapter number--as well as page number to identify the entry location?


2014-10-30 11:32:13

Leslie Rains

I tried the entry ({XE "My Index Entry" t "{SECTION}:{PAGE}"}) to add the section numbers to my index and it doesn't work. What I get in the Index is SECTION:PAGE instead of the numbers.

I even copied the formula from this tip, added my word, and it still wouldn't work.

I hate to add the section numbers manually as I'm working with a very large Word doc. I use Word 2007. Any ideas?

Thanks so much, Leslie


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.