- Home
- Docs
- User guides
- Document Editor
- Inserting field codes
Inserting 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,
- Go to the Insert tab.
- Click the Field button.
- 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 ]} |
|
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 ] } |
|
PAGEREF | The code inserts the page number as a bookmark for cross-reference. | { PAGEREF Bookmark [\* Format Switch ] } |
|
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 ] } |
|
REF | The code inserts the contents of the bookmark. The bookmark should be inserted in the document. | { [REF] Bookmark [Switches ] } |
|
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 ] } |
|
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 ] } |
|
STYLEREF | The code 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 ] } |
|
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] } |
|
The field codes can be edited and updated on the go:
- Select the required field and click with the right mouse button to open the context menu.
- Update field - update the information in the field.
- Edit field - open the window for editing the field.
- Toggle field codes - display the field code.
Host ONLYOFFICE Docs on your own server or use it in the cloud
Article with the tag:
Browse all tags