Articles with the tag:
Close
Changelog
Close
Articles with the tag:
Close
Try in the cloud
Try in the cloud

Insert field codes

In the Document Editor, you can add fields with dynamic content that depends on your system info or other content. Please do not confuse fields with content controls as these are two different features.

To insert a field,

  1. Go to the Insert tab.
  2. Click the Field button.
  3. In the opened dialogue window, enter the field code you need to be displayed and click OK.

The field codes are as follows:

ONLYOFFICE field code Description Syntax Switches
MERGEFIELD The code inserts a link to a data field from the other source into the current document. When merging, data from the other source will replace the current field value. { MERGEFIELD FieldName [ Switches ]}
  1. \b - specifies the text to be inserted before the MergeField field, if the latter is not blank.
  2. \f - specifies the text to be inserted after the MergeField field, if the latter is not blank.
  3. \m - specifies that the MergeField field is a mapped one.
  4. \v - enables character conversion for vertical formatting.
PAGENUM The code inserts the current page number.
PAGECOUNT The code inserts the total number of pages in the current document.
FORMTEXT
TOC The code creates a table of contents. The table of contents is based on the applied heading styles, outline levels, captions, etc., specified by Table of Contents Entry fields. { TOC [Switches ] }
  1. \a - creates a list of objects that does not include labels and numbers.
  2. \b - creates a table of contents for the bookmarked part of the document.
  3. \с - creates a list of objects of the specified type.
  4. \d - determines the separator type for page numbers.
  5. \f - creates a table of contents based on the TC fields and not the document structure levels.
  6. \h - applies hyperlink formatting to the table of contents.
  7. \l - specifies the required levels of TC fields. The levels that are not included in the specified range will be omitted.
  8. \n - creates a table of content either fully or using only the elements from the specified range (e.g., "1-9"), omitting page numbers.
  9. \o - creates a table of contents using only structure levels of the document and not the TC fields.
  10. \p - specifies the separator between the element and the corresponding page number.
  11. \s - adds a sequence number to the page number.
  12. \t - creates a table of contents using only custom styles instead of the default styles.
  13. \u - creates a table of contents using only the applied paragraph formatting outline level.
  14. \w - preserves the tabulation in table entries.
  15. \x - preserves line breaks in table entries.
  16. \z - hides page number while viewing the table of content as a web document layout.
PAGEREF The code inserts the page number as a bookmark for cross-reference. { PAGEREF Bookmark [\* Format Switch ] }
  1. \h - creates a hyperlink to the specified paragraph.
  2. \p - inserts the position of the specified paragraph relative to the bookmark.
PAGE The code inserts the number of the current page. { PAGE [\* Format Switch ] }
NUMPAGES The code inserts the total number of pages in the document. { NUMPAGES }
ASK The code inserts a field that prompts the user to enter data that will then be stored as a bookmark. The editor will prompt the user each time this field is refreshed or during merging. { ASK Bookmark"Prompt" [Optional switches ] }
  1. \d - inserts the default replacement text as a bookmark.
  2. \o - prompts just once when merging documents.
REF The code inserts the contents of the bookmark. The bookmark should be inserted in the document. { [REF] Bookmark [Switches ] }
  1. \d - specifies the separator for the page number.
  2. \f - increments footnote or note numbers and inserts them into the document.
  3. \h - creates a hyperlink to the specified paragraph.
  4. \n - adds paragraph numbers, if any.
  5. \p - inserts the position of the specified paragraph relative to the bookmark.
  6. \r - inserts the relative number of the specified paragraph.
  7. \t - omits symbols that are non-numerical or non-delimiter.
  8. \w - inserts the full number of the specified paragraph.
HYPERLINK The code inserts a hyperlink to an element in the document, to a document on your hard disk drive, portal, or a third-party resource. { HYPERLINK "Filename" [Switches ] }
  1. \l - specifies the element within the document to go to.
  2. \m - specifies coordinates to a hyperlink for a server-side image map.
  3. \n - opens the end document in a new window.
  4. \o - specifies the ScreenTip text.
  5. \t - specifies the target of the hyperlink.
TIME The code inserts the current time based on the user's system into the document. { TIME [\@ "Date-Time Picture"] }
DATE The code inserts the current date based on the user's system into the document. { DATE [ \@ "Date-Time Picture"] [Switches] }
FORMULA The code performs calculation as per the entered formula. { = Formula [Bookmark ] [\#Numeric Picture ] }
SEQ The code provides a way to number chapters, tables, figures, and other elements in a document in order. If you add, remove, or relocate an item along with its Seq field, you can update the other Seq fields in the document to show the revised sequence. { SEQ Identifier [Bookmark ] [Switches ] }
  1. \c - inserts the closest preceding sequence number.
  2. \h - hides the field result (used for cross-referencing).
  3. \n - inserts the next sequence number.
  4. \r - the numeration starts with the specified nymber.
  5. \s - the numeration starts with the specified outline level.
STYLEREF The code ads adds text that has been formatted using a specific style. When placed in a header or footer, it displays the first or last instance of text formatted with that style from the main content of the current page, enabling the creation of dictionary-style headers or footers. { STYLEREF StyleIdentifier [Switches ] }
  1. \l - starts the search from the bottom of the current page.
  2. \n - inserts the numeration from the specified paragraph.
  3. \p - inserts the position of the specified paragraph relative to the bookmark.
  4. \r - inserts the relative number of the specified paragraph.
  5. \t - omits symbols that are non-numerical or non-delimiter.
  6. \w - inserts the full number of the specified paragraph.
NOTEREF The code inserts a footnote or endnote reference mark that is marked with a bookmark to make references to the same note or to cross-reference footnotes and endnotes. If the sequence of the notes is changed, the result of the field will reflect the new numbering. { NOTEREF Bookmark [Switches] }
  1. \f - inserts a reference mark formatted with the Footnote reference style or the Endnote reference style.
  2. \h - creates a hyperlink to the specified foot- or endnote.
  3. \p - inserts the relative position of the foot- or endnote.
Return to previous page
Try now for free Try and make your decision No need to install anything
to see all the features in action