Wordprocessing Fields


A field is placed within XML as either a <w:fldSimple> (for a simple field) or within a pair of <w:fldSimple> elements (for a complex field). But the actual definition of the field type and format are specified by the instr attribute of the simple field or the <w:instrText> element or elements. The syntax of the field definitions does not follow XML standards, but instead a field is specified with a field name or key word followed by zero or more switches which affect formatting of the result. Below is a sample of a date field.

DATE \@ "M/d/yyyy h:mm am/pm"

This produces the following result sample: 1/3/2006 5:28 PM.

Field Types

The OOXML specification divides fields into 10 functional categories:

Field Formatting

The formatting of fields is specified with switches placed after the field name. There are three types of general switch types:

In addition, each field may have its own switches.

Reference: ECMA-376, 3rd Edition (June, 2011), Fundamentals and Markup Language Reference § 17.16.4.