Skip to main content
All docs
V24.1

REF

  • 2 minutes to read

Non-MailMerge Field

{ REF “bookmark” [switches] }

Inserts bookmarked text or graphics.

Use the SubDocument.Bookmarks property to access the collection of document bookmarks.

The REF field supports the following switches:

Switch Description
\d “separator” When used with \n, \r, \w, and \s switches, specifies the characters that separate sequence numbers and page numbers.
\f If the bookmark contains a comment, the REF field inserts the bookmarked text with the comment. If the bookmark contains a footnote or endnote, the REF field inserts the bookmarked text, increments the footnote or endnote number and inserts the note text. This switch is not available if the REF field is in the header or footer.
\h Creates a hyperlink to the bookmarked text or graphics.
\n Inserts the bookmarked paragraph’s number. Does not include previous level numbers.
\p Inserts the field position relative to the bookmark. If the REF field is in the document before the bookmark, it inserts the text “below”. If the REF field is after the bookmark, it inserts the text “above”. If the REF field is in the bookmark, an error is returned. When used with \n, \r, \s, or \w switches, appends the text “above” or “below” to the end of the paragraph number. This switch is not available if the REF field is in the header or footer.
\r Inserts the bookmarked paragraph’s number relative to the context or paragraph numbering scheme. If the field and the bookmark are on different paragraph levels, the field result includes all level numbers between them.
\t When used with \n, \r, and \w switches, deletes all non-limiter and non-numerical characters from the bookmarked paragraph’s number.
\w Inserts the entire bookmarked paragraph’s number from any part of the document.
\s Inserts the entire bookmarked paragraph’s number, excluding all non-limiter and non-numerical characters.