How cross-reference fields in Word work
About cross-referencing in Word – what is a cross-reference?
In this article, you will find general information about cross-referencing in Word. You will learn how cross-reference fields in Word work, how to insert a cross-reference, etc. The information applies to both cross-references you insert using Word's own functionality and using the Word add-in DocTools CrossReferenceManager.
The DocTools CrossReferenceManager add-in makes it easier and faster to work with cross-references in Word than using the built-in functionality. However, cross-references you have inserted in a document using DocTools CrossReferenceManager work precisely as if they had been inserted using Word's built-in functionality.
This article is relevant for Word 2010, Word 2013, Word 2016, Word 2019, and Word for Microsoft 365.
What is a cross-reference in Word?
In general, a cross-reference is a note in a text that tells you to look somewhere else in the text for more information.
In Word, you can insert dynamic cross-references that can be updated if the text you refer to changes.
Technically, a cross-reference in Word is a field, i.e. set of codes that instructs Word to automatically insert material into a document. The material inserted by cross-reference fields can be text, section numbers, paragraph numbers, caption numbers, caption labels, etc. The field code can also include special information (referred to as switches) that make the field act or look in a special way. For example, a cross-reference field may function as a hyperlink so you can jump directly to the target of the cross-reference by clicking the field.
As opposed to cross-references you type manually, the great advantage of using cross-reference fields is that you only need to update fields to have the cross-references corrected if you have made changes to the document.
How to insert a cross-reference in Word?
Note that you can only insert cross-references to content that already exits in the document. For example, you cannot insert a cross-reference to a heading that has not yet been added to the document. In case you want to refer to something in another document, you can create a hyperlink.
The purpose of the article is not to go into detail about how to insert cross-references in Word but to explain how cross-references work. For completeness, here are the steps to follow to insert a cross-reference using the built-in functionality of Word:
- In your document, position the insertion point where the cross-reference is to be inserted.
- In the Ribbon, select References tab > Captions group: Cross-references.
Note that you will also find the command in Insert tab > Links group: Cross-references.
The following takes place in the Cross-reference dialog box. See the illustration below. - In the Reference type list, select the type you want.
You can select from: Numbered item, Heading, Bookmark, Footnote, Endnote plus caption types depending on which caption labels are available (e.g. Figure, Table, Equation). Note that the dialog box shows all types no matter whether there are any targets of the different types in your document. - In the Insert reference to list, select what type of content you want the cross-reference to show.
The items in the list depend on what you selected as the reference type in step 3. - Turn on Insert as hyperlink if you want the cross-reference field to function as a hyperlink so users can click or Ctrl-click it to jump to the target.
- In the For which list, select the item the cross-reference must refer to.
The list is empty if no items match the reference type you selected. - Click Insert.
When you have clicked Insert in the Cross-reference dialog box, a cross-reference field is inserted in your document. Note that you must update cross-references yourself if you make changes to the document that influence the cross-reference targets.
The procedure above includes the main steps needed for most cross-references. In the Cross-reference dialog box, the Separate numbers with and Include above/below check boxes are enabled under some conditions. They are used for special purposes and are not covered here.
If you want to insert cross-reference constructions like "See Section 1.2, "This is the title", page 14", you will need to type the surrounding text and repeat the steps above three times because you need a cross-reference to three items: The paragraph number (1.2 in the example), the paragraph text ("This is the title" in the example) and the page number (14 in the example). On the other hand, the DocTools CrossReferenceManager add-in lets you insert entire cross-reference constructions like "See Section 1.2, "This is the title", page 14" in a single operation.
What to do if headings are missing in the Cross-reference dialog box?
In the illustration above, you can see that Heading is selected as the reference type in the Cross-reference dialog box. You can see that several headings are listed in the For which heading field.
If your document has a number of headings and if all or some of the headings are missing in the dialog box, you need to check the formatting of your document. All paragraphs that are formatted with one of the built-in styles Heading 1-9 are automatically shown in the dialog box. If you have used other styles for the headings, they will only appear in the heading list if the outline level of each of the headings has been set to one of the levels Level 1-9 in the Paragraph dialog box > Indents and Spacing tab > Outline level field. Headings with the outline level is set to Body Text will not appear in the target list.
Note that the style names of Heading 1, Heading 2, … , Heading 9 are language-specific. If your Word isn't English, you will see another word than "Heading" but still with the numbers 1-9. For example, the styles are named Overskrift 1, Overskrift 2, etc. in Danish.
See also Shauna Kelly's article Why use Microsoft Word’s built-in heading styles?
Are there different types of cross-reference fields?
Let's look a bit closer into the cross-reference fields. When you insert a cross-reference, the field code inside the field will depend on what the reference refers to. There are three types of cross-reference fields in Word. The first part of the field code of a cross-reference field tells which type of field it is. The field type can be one of the following:
- REF
- PAGEREF
- NOTEREF
You can read more about the syntax later in this article.
Below, you can read about how the three types of cross-references work.
Type of field
Description
PAGEREF
A cross-reference field that directly or relatively refers to the page on which the target is found is of the type PAGEREF. When you select “Page number” as the “Reference to insert” in the built-in Cross-reference dialog box in Word or in the Insert Cross-reference dialog box in DocTools CrossReferenceManager, the inserted cross-reference field will be of the type PAGEREF. Also, the custom text placeholders {P} and {P_a/b} that can be used in DocTools CrossReferenceManager will insert PAGEREF fields.
NOTEREF
A cross-reference field with a footnote or an endnote as the target will be of the type NOTEREF.
REF
All other cross-reference fields will be of the type REF.
How does a cross-reference field know which content to show?
In order for a cross-reference field to show the correct content, it must include information that makes this possible – and that is precisely what it does. The field code inside a cross-reference field refers to a bookmark that points out the target
A bookmark in Word is a named location or a named block of text or other content in a document.
The field code inside a cross-reference field includes a reference to a bookmark that acts as the target of the cross-reference. See the illustration below.
If you use the built-in functionality in Word for inserting e.g. a cross-reference to a heading, Word automatically adds a bookmark around the heading text, excluding the paragraph mark, if such bookmark is not already found. The name of the bookmark is included in the field code of the cross-reference field. Such automatically added bookmarks are named _Ref followed by eight or nine digits.
When inserting a cross-reference to a caption, a bookmark will also be used to enclose the part of the caption content that is to be displayed by the cross-reference field. The bookmark will enclose different parts of the caption depending on the kind of caption reference you select (e.g. the entire caption or only the label and number).
Example of cross-reference bookmark name
_Ref123456789
The underscore in start of the bookmark name results in the bookmark being handled as a hidden bookmark in Word. You cannot add hidden bookmarks manually, i.e. the built-in Bookmark dialog box doesn’t let you start a bookmark name with “_”.
Hidden bookmarks remain invisible on the screen even if you turn on display of bookmarks. In the Bookmarks dialog box, you must turn on Hidden bookmarks to have the hidden bookmarks listed in the dialog box.
You can see a list of bookmarks in a Word document in the Bookmark dialog box. To open the dialog box, select Insert tab in the Ribbon > Bookmark or press Ctrl+Shift+F5.
Note that names of bookmarks added by DocTools CrossReferenceManager follow the same syntax rules as the bookmarks added by the built-in cross-reference functionality.
What is the syntax of the field code in cross-reference fields of the types REF, PAGEREF and NOTEREF?
REF field code syntax
The syntax for REF fields is:
{ [REF] Bookmark [\* Format Switch ] [Switches ] }
The format switch and switches parts are optional.
Examples:
PAGEREF field code syntax
The syntax for PAGEREF fields is:
{ PAGEREF Bookmark [\* Format Switch ] [Switches ]}
The format switch and switches parts are optional.
Examples:
NOTEREF field code syntax
The syntax for NOTEREF fields is:
{ NOTEREF Bookmark [\* Format Switch ] [Switches ]}
The format switch and switches parts are optional.
Examples:
How to format cross-references?
You may want cross-references in a Word document to stand out from the surrounding text. You can use switches to change the formatting of cross-references. As mentioned above, a "switch" in a Word field is special information that makes the field act or look in a special way.
Note that the DocTools CrossReferenceManager can automatically format cross-references. For example, you can automatically apply a style to cross-references you insert. For help on manually formatting cross-references, see Formatting Cross-references.
How to find information about the field switches?
As mentioned above, a "switch" in a Word field is special information that makes the field act or look in a special way.
In the general help on Word, you can find information about the different types of switches that can be used with specific fields.
The fastest way to find this information is often to search using your preferred browser. You can search for "field codes [TYPE OF FIELD] field" (example: "field codes ref field") or something similar. You will find a full list covering all field types in the Microsoft article List of field codes in Word.
Are cross-references updated automatically?
Note that cross-references do not update automatically. If cross-references refer to headings, bookmarks, numbers or other targets that have been changed, you need to update the fields to reflect the changes.
You can update cross-references manually by selecting all (Ctrl+A) and pressing F9. Cross-references will also be updated when you switch to Print Preview or when you print if the Word option File > Options > Display > Printing options: Update fields before printing is turned on.
For detailed information about how all types of fields are updated, see my article Updating Fields in Word – How it Works.
How to fix broken cross-references that do not show the correct content?
You may experience that one or more cross-reference fields in a document do not show the expected content even if you have updated fields.
For example, you may experience problems of the following types:
- A cross-reference is missing part of the text it should have shown
- A cross-reference to a numbered heading shows 0 instead of the expected number or shows a wrong number
- A cross-reference includes more text than expected
- A cross-reference shows an error, telling that the reference source is not found.
If you run into such problems, my article Cross-reference Problems – Troubleshooting on my website thedoctools.com can help you understand the cause of the problems and help you solve them. The article includes videos that illustrate what causes the problems and how to solve them.
Note that my add-in DocTools CrossReferenceManager can help you automatically find and fix cross-reference problems. It can even prevent some of the problems from occurring.
Did you know that...
DocTools Word Add-Ins
can help you save time and work more efficiently in Word
Generate complete documents in seconds from re-usable text or graphics
Manage comments in Word fast and easy – review comments, extract comments to Word or Excel, etc.
Simplify and speed up the management of cross-references even in your most complex documents
Manage and repeat data in Word fast and easy with custom document properties and DocProperty fields
Extract insertions, deletions and comments from any Word document, incl. context and headings
Apply any highlight color or remove highlight in Word with a single click – customizable shortcuts
Browse pages, sections, headings, tables, graphics, etc. and find text in Word with a single click
Check safety-critical procedure documents for human factor issues in minutes – improve quality and help prevent errors
Create screen tips in Word fast and easy – with up to 2040 characters
Understanding cross-referencing in Word and how cross-reference fields in Word work can save you from a lot of time and trouble with Word documents. I hope this article helps you in your future work with cross-references in Word.