Document Editing Problems

Create a Word Index with Song Numbers Instead of Page Numbers

Ayan MasoodAyan Masood Nov 20, 2026 870 views

Question details

Create a Word index that displays each song's numbered list position instead of its page number.

Create a Word Index with Song Numbers Instead of Page Numbers
Product
Microsoft Word
Device & OS
not provided
Scenario
A song list uses numbered headings, and the user wants an index that retrieves the song numbers automatically.
Observed behavior
The index shows song titles, but the attempted automatic entry does not display a song number.
Before you start

Check that each song title uses the same heading style and an automatic list number. The example below uses Heading 2; substitute your actual style name if it differs.

Solution 1Recommended

Use XE and STYLEREF fields to display song numbers

Use this method to retrieve the number of a song's heading as the alternate text for its index entry.

1
Number the song headings

Apply Heading 2 to each song title from Home > Styles, then use Home > Numbering or Multilevel List to give the headings automatic numbers.

2
Insert an index entry

Place the cursor in a song heading or the paragraph immediately after it. Insert an XE field with a nested STYLEREF field so the code reads: { XE "Song Title" \t { STYLEREF "Heading 2" \w } }. Replace Song Title with the actual title. Create each pair of field braces with Ctrl+F9 on Windows or Cmd+F9 on Mac; do not type ordinary braces.

3
Repeat for each song

Add an XE field for each song, changing the quoted title while keeping the STYLEREF style name matched to the numbered headings.

4
Insert or update the index

Use References > Insert Index to create the index. Press Ctrl+A, then F9 on Windows to update fields, and use References > Update Index to refresh the index. On a Mac, select the document and use the field-update command available for your keyboard.

5
Check a blank result

If an entry has no number, check that its heading has an automatic number, the STYLEREF style name is correct, and the nested field uses the \w switch. Update the nested STYLEREF field and then update the index again.

Use XE and STYLEREF fields to display song numbers
Use automatic numbering: The \w switch retrieves a paragraph's numbering. A number typed as ordinary heading text is not an automatic list number.
Free Microsoft Office alternative

Edit Your Song List in WPS Writer

WPS Office is a free, lightweight alternative with a familiar interface for editing song lists and other documents. Its Word-format compatibility helps you move existing files into WPS Writer; the Word-specific nested-field method above is not guaranteed to work in WPS.

Organize song titles with headings and numbered listsOpen and edit Microsoft Word DOC and DOCX filesUse a familiar document-editing interfaceMove existing documents to a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Why does my index show a song title but no number?

Check that the song heading has an automatic list number and that the nested STYLEREF field names the correct heading style and includes \w. Update the nested field, then choose References > Update Index.

Can I type the braces around a Word field?

No. Insert each pair of field braces with Ctrl+F9 on Windows or Cmd+F9 on Mac. Ordinary typed braces do not create a Word field.

What if my song titles use a style other than Heading 2?

Replace "Heading 2" in each STYLEREF field with the exact name of the style used by the numbered song headings, then update the fields and index.

Can I put the song number in an index entry manually?

Yes. Use an XE field such as { XE "Song Title" \t "1" }, then update the index. You must change the quoted number yourself if the song's position changes.