Back to Devexpress

Field Codes

wpf-17175-controls-and-libraries-rich-text-editor-fields-field-codes.md

latest5.8 KB
Original Source

Field Codes

  • Dec 16, 2021
  • 3 minutes to read

Syntax

Field codes appear between curly brackets ( { } ). You can switch between displaying the field code and the result for a selected field by selecting Toggle Field Codes in the context menu.

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

{ FIELDNAME Properties Optional_Switches }

  • FIELDNAME - This is the name of the field.
  • Properties - These are any instructions or variables that are used in a particular field. Not all fields have parameters, and in some fields, parameters are optional.
  • Optional switches - These are any optional settings that are available for a particular field. Not all fields have switches available, other than those that control the formatting of the field results.

For example, the {MERGEFIELD Weather.condition *Upper} field denotes the MERGEFIELD field bound to the Weather.condition data field, which displays the text in all caps.

Supported Fields

Field NameFunctionality
AUTHORInserts contents of the Author box from the Summary tab in the Document Properties dialog.
COMMENTSInserts contents of the Comments box from the Summary tab in the Document Properties dialog.
CREATEDATEInserts the current date and time. After a mail merge the field is replaced with the date and time of the mail merge operation.
DATEInserts the current date and time.
DOCPROPERTYInserts the value of the document property specified by the field parameter.
DOCVARIABLEEnables you to programmatically insert complex content when this field is updated.
HYPERLINKEnables you to navigate to another location or to a bookmark.
IFCompares two values and inserts the text according to the results of the comparison.
INCLUDEPICTUREInserts the specified image.
KEYWORDSInserts contents of the Keywords box from the Summary tab in the Document Properties dialog.
LASTSAVEDBYInserts the name of the last person who modified and saved the document.
MERGEFIELDRetrieves a value from the bound data source.
NUMPAGESInserts the total number of pages.
PAGEInserts the number of the page containing the field.
PRINTDATEInserts the date and time that a document was last printed.
REFInserts bookmarked text or graphics.
REVNUMInserts the number of document revisions.
SAVEDATEInserts the date and time a document was last saved.
SECTIONPAGESInserts the total number of pages in a section.
SEQProvides sequential numbering in the document.
STYLEREFInserts text that is formatted with the specified style.
SUBJECTInserts contents of the Subject box from the Summary tab in the Document Properties dialog.
SYMBOLInserts a symbol.
TCDefines entries for the table of contents.
TEMPLATEInserts the name of a template attached to the document.
TIMEInserts the current time.
TITLEInserts contents of the Title box from the Summary tab in the Document Properties dialog.
TOCBuilds a table of contents.

Formatting Options

The following format switches are supported.