Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

The Ref field inserts the text or graphics represented by the specified bookmark. The bookmark must be defined in the active document. To insert bookmarked text or graphics from another document, use the IncludePicture or IncludeText field. The Cross-reference command (Insert tab, Links group) inserts Ref fields to create cross-references.

In most cases, you can use the bookmark name instead of the Ref field. Using the Ref field is optional except in cases where a bookmark name matches a Microsoft Word field name. For example, if the bookmark name is "Title", which matches the Word field name Title, you must use the Ref field instead of the bookmark name. The field { REF Title } inserts the text represented by the "Title" bookmark, whereas the field { Title } inserts the contents of the Title box on the Summary tab in the Properties dialog box.

Note: When you insert text copied from another location in the same document, the Paste Special command (Home tab, Clipboard group, Paste command) inserts a Ref field with the bookmark INTER_LINKn, where n is incremented automatically. You should not edit an INTER_LINKn bookmark in a Ref field. Also note that Ref fields with INTER_LINKn bookmarks in a mail merge main document can cause errors during merging.

Syntax

When you view the Ref field in your document, the syntax looks like this:

{ [REF] Bookmark [Switches ] }

Note:  A field code tells the field what to show. Field results are what’s shown in the document after having evaluated the field code. To toggle between viewing the field code and the field code results, press Alt+F9.

Instructions

Bookmark

The name of a bookmark. If the text marked by the bookmark contains a paragraph mark, the text preceding the REF field assumes the formatting of the paragraph in the bookmark.

Switches

\d

Specifies the characters that separate sequence numbers (such as chapter numbers) and page numbers.

\f

Increments footnote, endnote, or annotation numbers that are marked by the bookmark and inserts the corresponding note or comment text. For example, the bookmark "Note1" marks the reference mark of footnote 1. The field { REF Note1 \f } is inserted after footnote 2. The field result displays the footnote reference mark "3" in the document text and inserts the text of footnote 1 into the footnote window.

\h

Creates a hyperlink to the bookmarked paragraph.

\n

Causes the field to display the entire paragraph number for a referenced paragraph without trailing periods. No information about prior levels is displayed unless it is included as part of the current level.

\p

Causes the field to display its position relative to the source bookmark using the word "above" or "below."

If the REF field appears in the document before the bookmark, it evaluates to "below." If the REF field appears after the bookmark, it evaluates to "above." If the REF field appears within the bookmark, an error is returned.

This switch can also be used in conjunction with the \n, \r, and \w switches. When this is done, "above" or "below" is appended to the end of the field result.

\r

Inserts the entire paragraph number of the bookmarked paragraph in relative context — or relative to its position in the numbering scheme — without trailing periods.

\t

Causes the REF field to suppress non-delimiter or non-numerical text when used in conjunction with the \n, \r, or \w switch.

With this switch, for example, you can reference "Section 1.01," and only "1.01" is displayed in the result.

\w

Inserts the paragraph number of the bookmarked paragraph in full context from anywhere in the document.

For example, when referencing paragraph "ii.," a REF field with the \w switch would return "1.a.ii" as a result.

Examples

The following REF field assigns the result of an ASK field that prompts the user for the cost per unit. The ASK field prompts the user for information when the field is updated and then assigns the user's input to the bookmark "unitcost":

{ ASK unitcost "What's the cost per unit?" }

{ REF unitcost }

Need more help?

Want more options?

Explore subscription benefits, browse training courses, learn how to secure your device, and more.

Communities help you ask and answer questions, give feedback, and hear from experts with rich knowledge.

Was this information helpful?

What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×