When you build an index in Word, the XE (Index Entry) fields that define a range using a bookmark should generate a page range in the final index, such as “12–14.” Instead, some users see the raw XE field code or the bookmark name displayed as plain text in the index output. This problem occurs because the XE field’s switch syntax is incorrect, the bookmark is missing, or the field codes are set to display instead of their results. This article explains the exact causes of this issue and provides step-by-step fixes to restore proper page range display in your index.
Key Takeaways: Fixing XE Range Fields That Show Plain Text
- Alt+F9 to toggle field codes: Switches between displaying field codes and their results so you can verify the XE field syntax.
- Ctrl+Shift+F9 to unlink fields: Permanently converts field codes to plain text — do not use this on XE fields intended for index generation.
- Insert > Index > Update Index: Rebuilds the index after correcting the XE field syntax or bookmark definition.
Why XE Range Fields Display as Plain Text in the Index
An XE field with a range switch uses the syntax { XE "Entry Text" \r "BookmarkName" }. The \r switch tells Word to display the page range covered by the bookmark instead of a single page number. If the bookmark name in the switch does not match an existing bookmark, or if the bookmark spans only one page, Word cannot calculate a range and may fall back to showing the field code or the bookmark name as text.
Another common cause is that field codes are set to display globally. When you press Alt+F9, Word toggles between showing field codes (the raw syntax) and field results (the computed page number or range). If the document is saved with field codes visible, or if the XE field itself is accidentally unlinked using Ctrl+Shift+F9, the field becomes static text and will not participate in index generation.
The Role of the Bookmark in Range Indexes
A bookmark must be defined across at least two pages for a page range to appear. If the bookmark starts and ends on the same page, Word shows a single page number, not a range. If the bookmark is deleted after the XE field is inserted, Word cannot resolve the range and displays the bookmark name literally in the index entry.
Steps to Fix XE Range Fields Showing as Plain Text
- Toggle field codes with Alt+F9
Press Alt+F9 to switch between field code display and field result display. If you see the raw XE syntax such as{ XE "Topic" \r "MyBookmark" }, the issue is that field codes are visible. Press Alt+F9 again to show results. If the index still shows plain text, proceed to the next step. - Verify the bookmark exists and spans multiple pages
Go to Insert > Bookmark. In the Bookmark dialog, check that the bookmark name used in the XE field (for example, “MyBookmark”) is listed. If it is missing, select the text that should define the range and create a new bookmark with the exact same name. Ensure the selection covers at least two pages. Click Add. - Check the XE field syntax for the \r switch
Place your cursor on the XE field code. Press Shift+F9 to toggle just that field. Confirm the syntax is{ XE "Entry Text" \r "BookmarkName" }. There must be a space before and after the\rswitch. If the switch is missing, type it manually. Do not use curly braces around the bookmark name — use straight double quotes. - Update the index
Click anywhere inside the generated index. On the References tab, click Update Index. Word rebuilds the index using the corrected XE fields. If the index still shows plain text, delete the entire index and reinsert it from Insert > Index > Index. - Ensure the XE field is not unlinked
Select the XE field code. If the field is grayed out and cannot be toggled, it may have been unlinked with Ctrl+Shift+F9. Delete the XE field and reinsert it by selecting the text in the document body, then pressing Alt+Shift+X. Reapply the range switch manually after insertion.
If Word Still Has Issues After the Main Fix
Word Displays the Bookmark Name Instead of a Page Range
If the index shows the bookmark name (for example, “MyBookmark”) instead of a page range, the bookmark likely does not span multiple pages. Select the bookmark content in the document and extend the selection to include text on at least two pages. Open Insert > Bookmark, select the bookmark, click Delete, then re-create it with the same name over the corrected range. Update the index.
XE Field Shows as { XE … } in the Index Output
This indicates that field codes are visible in the entire document. Press Alt+F9 to toggle all field codes off. If the problem persists, check File > Options > Advanced. Under Show document content, ensure the box “Show field codes instead of their values” is unchecked. Click OK and update the index.
Index Entry Shows Plain Text From a Copied Document
When you copy content from another document, XE fields may carry over with broken references. Delete the imported XE fields by showing hidden formatting (Ctrl+Shift+8) and removing the XE field brackets. Reinsert the XE fields using Alt+Shift+X and manually add the \r switch with the correct bookmark name.
XE Field States: Field Code vs Field Result in Index Generation
| Item | Field Code Display | Field Result Display |
|---|---|---|
| Visual appearance | Shows curly braces and syntax like { XE “Topic” \r “B1” } | Shows the computed page number or range like 12–14 |
| Toggle method | Alt+F9 or Shift+F9 for single field | Same keys toggle back |
| Index generation behavior | Index may show raw field text if field codes are on globally | Index uses the computed value |
| Risk of data loss | Low — field code can be toggled back | Low — field can be toggled back unless unlinked |
| Recommended state for final output | Off (show results) | On |
Always keep field codes hidden in the final document by pressing Alt+F9 until all fields show their results. Update the index one last time before saving or printing.
After applying these fixes, you can generate a clean index with page ranges instead of plain text or field codes. Always verify your bookmark spans at least two pages and that the XE field uses the \r switch with a matching bookmark name. As an advanced tip, use the Go To feature (Ctrl+G) and select Bookmark to quickly jump to each bookmark and confirm its page span before updating the index.