Field codes: PageRef field

The PageRef field inserts the page number of a bookmark (bookmark: A location or selection of text in a file that you name for reference purposes. Bookmarks identify a location within your file that you can later refer or link to.) for a cross-reference. To cross-reference items in a document, use the Cross-reference command (Insert tab, Links group).

Syntax

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

{ PAGEREF Bookmark [\* Format Switch ] }

 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

\* Format Switch

Optional switch that overrides the numeral style (style: A combination of formatting characteristics, such as font, font size, and indentation, that you name and store as a set. When you apply a style, all of the formatting instructions in that style are applied at one time.) selected in the Number format box in the Page Number Format dialog box (Insert tab, Headers & Footers group, Page Number command, Format Page Numbers).

Switches

\h

Creates a hyperlink (hyperlink: A word, phrase, picture, icon, symbol or other element in a computer document or webpage on which a user may click to move to another part of the document or webpage or to open another document, webpage, or file.) to the bookmarked paragraph.

\p

Causes the field to display its position relative to the source bookmark.

The string "on page #" is used when the PageRef field is not on the current page. When the PageRef field is on the current page, it omits "on page #" and returns "above" or "below" only.

Example

In the following example, the bookmark "Worldpop1990" marks the table containing figures for 1990.

Field:

The world population in 1991 was 5 billion; for 1990 figures, see the table { PAGEREF Worldpop1990 \p }.

Result:

The position of the table is inserted in place of the field:

"... see the table above."

 
 
Applies to:
Word 2013, Word 2010