A family of Microsoft word processing software products for creating web, email, and print documents.
(Edit: info. about the Word 2013 fields DISPLAYBARCODE and MERGEBARCODE added).
(Edit: info. about the esoteric DISPLAYNFC field added)
> I'd like to know if there exists a comprehensive list of all possible field codes that can be used in microsoft word.
I've never found a complete list - even the ISO standards documents and the binary .doc format specification omit some Mac-only fields. So last year I created a list of my own - see below. I don't think Word 2010 introduced any new ones.
To find the page number of the first page, you can
a. bookmark a piece of text in the body of the first page - e.g. call it "firstpage". Or insert a { SET firstpage } field
b. use { PAGEREF firstpage \*Arabic} to get the page number of firstpage and use it in your page numbering calculation. However, there are likely to be complications if, e.g., you have multiple sections and so on.
Below is a list of all the field types available since the first version
of Word for Windows, not including the localised versions of the field
names (these were used in localised versions of Word 97 and earlier for
example the Dutch language version of Word used MACROBLOKJE instead of
MACROBUTTON).
Some of these fields are Mac-only, e.g. SUBSCRIBER; some of those
probably do not work on Mac OS X. Some are Windows Word only, such as
ADDRESSBLOCK.
Some fields have been renamed and/or extended. For example, IMPORT was
replaced by INCLUDEPICTURE.
Some fields have been declared as obsolescent in the ISO OOXML
standards. Some syntax, such as the ability to say { QUOTE 65 66 67 } to
insert "ABC" does not seem to be allowed by the ISO standard, so it is
not completely clear what will happen if and when Word creates files
that confrom to that standard.
Some fields have rarely, if ever been documented by Microsoft. I think I
know what almost all of them do, but if anyone can tell me what
DISPLAYNFC was for, please let me know! (More on this in the list below)
Some fields still function but Microsoft said that they should not be
used quite a long time ago, suggesting alternatives. For example
DDE
DDEAUTO
SKIPIF (Microsoft suggests using the filter options in merge, but this
is not always a practical alternative)
EQ ( Microsoft regardd the equation editor as a successor, but many
people still use EQ fields for a number of reasons
I would avoid some fields on the grounds that another field type does
much the same thing more reliably. LISTNUM is a good example.
I do not cover Content Controls (Word 2007) here.
This list comes from a website I am currently developing but which is
not yet ready to be published.
List of Word field types
Name Title
(Bookmark) Inserts the value of the specified bookmark
(Empty) A field with no content
(Equation) The current name for the EQ field
(Expression) Expression was the original name for "= fields"
(Formula) In current documentation, a "Formula field" means an "=
field". In older documentation, it meant an "EQ field"
= Inserts the result of an arithmetic expression. Now known as a
Formula field - previously, as an Expression field
ADDIN Stores information - intended for use by ADDINs. Does not
display a result
ADDRESSBLOCK Inserts an address composed of a number of fields from a
MailMerge data source
ADVANCE Causes the text following the field to start at a different
location
ASK Prompts for the user to input text and uses that text to set the
value of a bookmark
AUTHOR Inserts or updates the text in the "Author" built-in Document
Property
AUTONUM Inserts an automatic paragraph number
AUTONUMLEGAL Inserts an automatic paragraph number using a legal
numbering convention
AUTONUMOUT Inserts an automatic paragraph number using an "Outline"
paragraph numbering scheme
AUTOTEXT Inserts the value of a Word Autotext entry
AUTOTEXTLIST Displays a list of Autotext entry names, allows selection
of one, then inserts the selected autotext
BARCODE Inserts a United States Postal Service (USPS) Barcode. No
longer works according to USPS requirements and made hard to use in Word
2007
BIBLIOGRAPHY Inserts a bibliography based on Citation fields
BIDIOUTLINE Switches the text direction...
CITATION Inserts a bibliographic citation from a master list
COMMENTS Inserts or updates the text in the "Comments" built-in
Document Property
COMPARE Compares two values. If they match, return 1, otherwise return 0
CONTACT Inserts the Contact with the specified ID from the Address Book
(Mac only)
CONTROL Displays an ActiveX control such as a text input field from the
Control toolbox
CREATEDATE Inserts the date/time when the document was created
DATA (Obsolete) defined the data source and optional header source for
a MailMerge in Word 1 for Windows. No field is used for this in later
versions of Word.
DATABASE Inserts a table of data, or a single value, from a data source
DATE Inserts the current date (and optionally, time)
DDE Inserts the result of a DDE (Dynamic Data Exchange) item from a
DDE server
DDEAUTO Inserts the result of a DDE item and updates the result
automatically
DISPLAYBARCODE displays a
UPCA|UPCE|JAN13|JAN8|EAN13|EAN8|CASE|ITF14|NW7|CODE39|CODE128|JPPOST|QR barcode (Word 2013 only)
DISPLAYNFC appears to be a "pseudofield" used when defining the numbering scheme, e.g in multilevel lists. To see it,
a. go to Word 2010's Home tab, Paragraph group, Multilevel list dropdown,
b. select one of the list formats with numbering
c. click Define new Multilevel list
d. select some of the numbering in the "Enter formatting for number" box
e. copy/paste into a Word document
f. if you don't see anything, toggle field codes with Alt-F9. You should see field codes like
{ DISPLAYNFC \l 0 } etc, where the \l number corresponds to a level in the list.
The field doesn't actually display any result in the document, so I suspect it is there to help Word remember exactly which level each number in that "Enter formatting for number" box actually standas for (and/or, to allow users to copy/paste those numbers without the information about their level being lost.
DOCPROPERTY Inserts the value of a Built-in or Custom Document Property
DOCVARIABLE Inserts the value of a Word Variable object
EDITTIME Inserts the number of minutes that a document has been open
for editing
EMBED A "placeholder" for an embedded OLE object or graphic
EQ Inserts a formatted mathematical equation. Can also be used to
"decorate" characters, e.g. with overbars.
FILENAME Inserts the filename or the full path name of the document
FILESIZE Inserts the file size of the document file in bytes
FILLIN Prompts for a piece of text and inserts the result
FORMCHECKBOX Displays a checkbox field in a Word "Online Form"
FORMDROPDOWN Displays a dropdown selection in a Word "Online Form"
FORMTEXT Displays a text field in a Word "Online Form"
FTNREF (Obsolete) Inserted a second or subsequent reference to a
footnote. Replaced by NOTEREF.
GLOSSARY (Obsolete) Inserted an item from Word's Glossary. Glossary was
a predecessor of the AUTOTEXT feature. Replaced by AUTOTEXT
GOTOBUTTON Inserts text that the user can click to move the insertion
point to a bookmarked location in the same document
GREETINGLINE Inserts a Greeting Line, typically in a letter (e.g. "Dear
Mr Smith")
HTMLCONTROL Displays an HTML form control such as a text box, checkbox,
dropdown etc.
HYPERLINK Inserts a link that the user can click to move to a specified
bookmark in the same document or to open a URL such as a Web page
IF Evaluates a condition and inserts one result if the condition is
True or another result if it is False
IMPORT (Obsolete) Inserted an image such as a .jpg from a file. Replaced
by INCLUDEPICTURE
INCLUDE (Obsolete) Inserted text from any document or "range" that could
be read using an internal or external text converter. Replaced by
INCLUDETEXT
INCLUDEPICTURE Inserts an image from any file format recognised by one
of Word's graphic converters, e.g. from a .jpg file
INCLUDETEXT Inserts all or part of a Word document or another document
type that can be read using an internal or external text converter
INDEX Inserts an Index constructed from Index Entry fields (XE fields)
INFO Inserts, and in some cases updates, document information such as
AUTHOR, COMMENTS, etc.
KEYWORDS Inserts and/or updates the text of the Keywords document property
LASTSAVEDBY Inserts the user name from Word's User Information as at
the point that the document was last saved
LINK Inserts an OLE link to information in either an external
information source or another part of the current document
LISTNUM Inserts an automatically generated list number (e.g. a
paragraph number)
MACROBUTTON Displays text/image which the user can click to run the
specified VBA macro
MERGEBARCODE displays a
UPCA|UPCE|JAN13|JAN8|EAN13|EAN8|CASE|ITF14|NW7|CODE39|CODE128|JPPOST|QR barcode (Word 2013 MailMerge only)
MERGEFIELD Inserts the value of the specified column of the current row
from a MailMerge (or on Mac Word, Data Merge) data source
MERGEREC Inserts the number of the current record in the MailMerge data
source
MERGESEQ Inserts the number of the current record in the MailMerge (on
Mac, Data Merge) data source
NEXT Instructs Word to move to the next record in the MailMerge (in
Mac Word, Data Merge) data source
NEXTIF Requests Word to move to the next record in the MailMerge data
source (on Mac, Data Merge data source) if the specified condition is
satisfied
NOTEREF Inserts a second or subsequent reference to a footnote
NUMCHARS Inserts the number of characters in the current document, as
at the last point the statistics were updated
NUMPAGES Inserts the number of pages in the current document according
to the most recent pagination
NUMWORDS Inserts the number of words in the current document according
to the most recent statistics
PAGE Inserts a page number or chapter-page number
PAGEREF Inserts the page number of the referenced item
PLACEHOLDER Displays the specified text. If the user clicks the
placeholder text and types, Word replaces the placeholder text by the
typed text. Mac only.
PRINT Outputs text, "escape characters","control characters" and
Postscript code directly to the printer driver
PRINTDATE Inserts the date/time the document was last printed
PRIVATE A storage area for - for example - original text from documents
converted from other document formats. For example used by Word's
WOrdPerfect converter to support "round-tripping"
QUOTE Inserts text exactly as specified in the field
RD (Referenced Document field) Specifies a document to be included
when constructing a Table of contents (TOC), Table of Authorities (TOA)
or Index (INDEX)
REF Inserts the content of the specified Word Bookmark, or a reference
to its location
REVNUM Inserts the current Document Revision Number
SAVEDATE Inserts the date and time that the document was last saved
SECTION Inserts the number of the current Word Section
SECTIONPAGES Inserts the number of pages in the current Word Section
SEQ Inserts the next number in a named sequence
SET Assigns text and/or other content to a bookmark name
SHAPE Represents certain kinds of objects inserted in the document
SKIPIF During a MailMerge, causes Word to cancel processing of the
current document and start again with the next record
STYLEREF Inserts a copy of the nearest material formatted with the
specified style
SUBJECT Inserts and optionally allows update of the Subject built-in
Document Property
SUBSCRIBER Used by the Mac PUBLISH and SUBSCRIBE system. Mac only.
SYMBOL Inserts the symbol with the specified character number from the
specified typeface
TA Specifies an entry to be inserted using a Table of Authorities
(TOA) field
TC Creates a Table of Contents entry for use by a Table of Contents
(TOC) field
TEMPLATE Inserts the filename or pathname of the Word template attached
to the document
TIME Inserts the current system time
TITLE Inserts and optionally updates the Title built-in Document Property
TOA Inserts a Table of Authorities constructed from entries made using
TA fields
TOC Inserts a Table of Contents for all or part of a document, based
on the text in heading paragraphs and/or TC fields
USERADDRESS Inserts the User Address specified in the User Information
options or specified in the field itself
USERINITIALS Inserts the User Initials specified in the User
Information options or specified in the field
USERNAME Inserts the User Name specified in the User Information
options, or a name specified in the field
USERPROPERTY Inserts a user property such as Fax number from the Address book entry for the user. Mac only.
XE Inserts an Index Entry for use by an INDEX field
Peter Jamieson