These destinations sit inside the text, anchored to the character before them: fields with their instructions and last result, footnotes and endnotes, comments, bookmarks, and the entries that Word gathers into an index or a table of contents.
Fields
<field> = '{' \field <fieldmod>? <fieldinst> <fieldrslt> '}'
<fieldmod> = \flddirty? & \fldedit? & \fldlock? & \fldpriv?
<fieldinst> = '{\*' \fldinst <para>+ <fldalt>? '}'
<fldalt> = \fldalt
<fieldrslt> = '{' \fldrslt <para>+ '}'
| Control word | Meaning |
|---|---|
\field | Destination: a field. |
\flddirty | The result’s formatting has changed since the field was last updated. |
\fldedit | Text has been added to or removed from the result since the last update. |
\fldlock | The field is locked and cannot be updated. |
\fldpriv | The result is not displayable, such as binary data for a field whose result is a picture. |
\fldinst | Destination: the field’s instructions, such as PAGE or HYPERLINK "https://…". A file name in it can carry \cpg. |
\fldrslt | Destination: the most recent result. Write it even when empty: readers that do not know fields still show it. It should not start with a table. |
\fldalt | At the end of the instructions: the reference is to an endnote, not a footnote. |
\datafield | Destination, always with \*: the binary data of a form field instruction, in hexadecimal. |
\fldtype, \date, \time, \wpeqn | Old field keywords; ignore them. |
Backslashes inside instructions are doubled, as in all RTF text: the Word switch
\* MERGEFORMAT is written \\* MERGEFORMAT. Examples from the
specification:
{\field {\*\fldinst AUTHOR \\*MERGEFORMAT }{\fldrslt Joe Smith}}\par\pard
{\field{\*\fldinst time \\@ "h:mm AM/PM"}{\fldrslt 8:12 AM}}
{\field{\*\fldinst NOTEREF _RefNumber } {\fldrslt 1}}
{\field{\*\fldinst NOTEREF _RefNumber \fldalt } {\fldrslt I}}
The last two refer to a footnote and to an endnote.
Form fields
A form field is a FORMTEXT, FORMCHECKBOX or
FORMDROPDOWN field whose instructions also hold a
{\*\formfield …} group, and a bookmark with the field’s name round it.
| Control word | Meaning |
|---|---|
\formfield | Destination: the form field’s settings. |
\fftypeN | Type: 0 text, 1 check box, 2 drop-down list. |
\fftypetxtN | Kind of text field: 0 regular text, 1 number, 2 date, 3 current date, 4 current time, 5 calculation. |
\ffownhelpN | 1: there is help text in \ffhelptext. |
\ffownstatN | 1: there is status bar text in \ffstattext. |
\ffprotN | 1: the field is protected. |
\ffsizeN | Check box size: 0 automatic, 1 exact (\ffhps). |
\ffhpsN | Check box size in half-points. |
\ffrecalcN | 1: recalculate the field on exit. |
\ffhaslistboxN | 1: the field has a list box. |
\ffmaxlenN | Maximum number of characters in a text field. |
\ffname | Destination: the field’s name. |
\ffdeftext | Destination: default text of a text field. |
\ffdefresN | Default entry of a list: 0 the first item, 1 the second, and so on. |
\ffformat | Destination: format of a text field. |
\ffhelptext | Destination: help text. |
\ffstattext | Destination: status bar text. |
\ffentrymcr | Destination: macro run on entering the field. |
\ffexitmcr | Destination: macro run on leaving the field. |
\ffl | Destination: one item of a drop-down list, repeated for each item. |
\ffresN | Current result of a form field: 0 to N−1, where N is the number of \ffl items. |
{\field{\*\fldinst {\*\bkmkstart Text1} FORMTEXT {{\*\datafield
00000000000000000554657874310008476565207768697a0000000000000000000000}}}{\fldrslt Default
Result}}{\*\bkmkend Text1}
In this example from the specification, the data field contains the name
Text1 (05 then 54 65 78 74 31) and the default
text Gee whiz (08 then
47 65 65 20 77 68 69 7a).
Footnotes and endnotes
<foot> = '{' \footnote <para>+ '}'
| Control word | Meaning |
|---|---|
\footnote | Destination: a footnote, anchored to the character before it. With automatic numbering it is preceded by \chftn, and the note text usually starts with its own \chftn. |
\ftnalt | After \footnote: the note is an endnote. Readers that do not know it treat it as a footnote. |
Microsoft programs do not support footnotes inside headers, footers or comments; they often corrupt the document. Placement and numbering are document properties.
\ftnbj\ftnrestart \sectd \linemod0\linex0\endnhere \pard\plain
\ri1170 \fs20 {\pu6 Mead's landmark study has been amply annotated.\chftn
{\footnote \pard\plain \s246 \fs20 {\up6\chftn }See Sahlins, Bateson, and
Geertz for a complete bibliography.}
It was her work in America during the Second World War, however, that forms
the basis for the paper. As others have noted, \chftn
{\footnote \pard\plain \s246 \fs20 {\up6\chftn}
A complete bibliography will be found at the end of this chapter.}
this period was a turning point for Margaret Mead.}
\par
The example is the specification’s; \pu6 in its second line is printed
so, and is not a defined word.
Comments (annotations)
A comment has two destinations with no group round them: the author’s initials and
the comment text, anchored to the character before them. If the comment covers a
range, the range is marked with \atrfstart and \atrfend.
Comments inside headers, footers or footnotes are not supported.
<annot> = <annotid> <atnauthor> <atntime>? \chatn <atnicn>? <annotdef>
<annotid> = '{\*' \atnid #PCDATA '}'
<atnauthor> = '{\*' \atnauthor #PCDATA '}'
<annotdef> = '{\*' \annotation <atnref> <para>+ '}'
<atnref> = '{\*' \atnref N '}'
<atntime> = '{\*' \atntime <time> '}'
<atnicn> = '{\*' \atnicn <pict> '}'
<atrfstart> = '{\*' \atrfstart N '}'
<atrfend> = '{\*' \atrfend N '}'
| Control word | Meaning |
|---|---|
\atnid | Destination: the author’s initials. |
\atnauthor | Destination: the author’s name. |
\chatn | The comment mark. |
\annotation | Destination: the comment text. |
\atnref | Destination: the name (such as a long integer) of the bookmark the comment belongs to. |
\atntime | Destination: when the comment was made. |
\atnicn | Destination: an icon for the comment, as a picture. |
\atrfstart | Destination: start of the commented range; the text is its name. |
\atrfend | Destination: end of the commented range. |
An example of a paradigm might be Newtonian physics or
Darwinian biology.{\v\fs16 {\atnid bz}\chatn{\*\annotation
\pard\plain \s224 \fs20 {\field{\fldinst page \\#'"Page:
'#'\line'"}{\fldrslt}}{\fs16 \chatn }
How about some examples that deal with social science?
That's what this paper is about.}}
Bookmarks
<book> = <bookstart> | <bookend>
<bookstart> = '{\*' \bkmkstart (\bkmkcolf? & \bkmkcoll?) #PCDATA '}'
<bookend> = '{\*' \bkmkend #PCDATA '}'
| Control word | Meaning |
|---|---|
\bkmkstart | Destination: the start of the bookmark named by its text. |
\bkmkend | Destination: the end of the bookmark of that name. Start and end match by name and may come in either order. |
\bkmkcolfN | First table column the bookmark covers (default the first). |
\bkmkcollN | Last table column it covers (default the last). |
{\*\bkmkstart paradigm} Kuhn calls such a presupposed structure a paradigm.{\*\bkmkend paradigm}
{\*\bkmkstart\bkmkcolf2\bkmkcoll5 Table1}
The second puts the bookmark Table1 on columns 2 to 5 of a table. A
bookmark name with characters outside the code page is written in
\upr.
Index entries
<idx> = '{' \xe (\xef? & \bxe? & \ixe?) <entry> (<txe> | <rxe>)? '}'
<entry> = (<char>+ <yxe>?) | ('{' <char>+ <yxe>? '}')
<yxe> = \yxe <char>+ #PCDATA
<txe> = '{' \txe <char>+ #PCDATA '}'
<rxe> = '{' \rxe #PCDATA '}'
Text of an entry that is not hidden with \v also appears in the
document, and so does \txe text. A colon control symbol,
\:, separates an entry from its sub-entry.
| Control word | Meaning |
|---|---|
\xe | Destination: an index entry. |
\xefN | Which index, for documents with several: N is the ASCII code of a letter A to Z. |
\bxe | Page number or cross-reference in bold. |
\ixe | Page number or cross-reference in italic. |
\txe | Destination: text to use instead of a page number, such as “See Animals”. |
\rxe | Destination: the name of a bookmark whose pages make the page range. |
\yxe | Pronunciation or heading of the entry, for phonetic sorting. |
\*\pxe | Destination: the “yomi” (pronunciation) of the entry, for Japanese. |
{\xe {\v Animals\:Dogs}}{\xe {\v Cats}{\txe See Animals}}
Table of contents entries
<toc> = '{' \tc | \tcn (\tcf? & \tcl?) <char>+ '}'
| Control word | Meaning |
|---|---|
\tc | Destination: an entry for a table of contents. Text not hidden with \v also appears in the document. |
\tcn | Destination: an entry without a page number. |
\tcfN | Which table: N is the ASCII code of a letter A to Z (default 67, “C”, the table of contents). |
\tclN | Level of the entry (default 1). |
{\tc\tcl2 {\v Background}}
Added after RTF 1.6
The RTF 1.9.1 specification (19 March 2008) adds threaded comments, move bookmarks, protection exceptions, custom XML markup, smart tags and custom XML data. None of these words is in the 1.6 specification; the flags are those of its control word index.
Comments
<annotdef> '{\*' \annotation <atndate>? <atnref> <atnparent> <para>+ '}'
<atndate> '{\*' \atndate <date> '}'
<atnparent> '{\*' \atnparent <annotid of parent> '}'
\*\atndate (no flag) gives the comment’s date; the specification’s
example writes {\*\atndate 1180187342}. \*\atnparent
(2002) names the comment this one replies to.
Move bookmarks
A tracked move is marked twice: the moved text carries the character words
\mvf or \mvt (see
character formatting), and
bookmarks mark where the move came from and went to, since moved text may later be
edited. Source and destination bookmarks share one tag.
<movebookstart> '{\*' (\mvfmf | \mvtof) #PCDATA #SDATA '}'
<movebookend> '{\*' (\mvfml | \mvtol) #PCDATA '}'
{\*\mvfmf move148856603 0100768baa46} <source> {\*\mvfml move148856603}
{\*\mvtof move148856603 0100768baa46} <destination> {\*\mvtol move148856603}
The tag is any alphanumeric string of up to 20 characters (Word writes
moveN). The hex data is 6 bytes: the author (2 bytes, little-endian,
the same value as \mvauthN) and the date and time as a DTTM.
\*\mvfmf and \*\mvtof start a move-from and move-to
bookmark, \*\mvfml and \*\mvtol end them; all flagged
2007. Text may be deleted from a move-to range.
Protection exceptions
'{\*' \protstart #PCDATA '}' … '{\*' \protend #PCDATA '}'
This is {\*\protstart 0300010003000000}SECTION 2. …
\*\protstart and \*\protend (2003) mark a range exempt from
document protection; the data after \protstart encodes the user name
(see \protusertbl on the
header page).
Custom XML markup and smart tags
Both attach customer-defined meaning to runs of text, for example marking a sentence
as a customer name. Smart tags give a namespace and name; custom XML markup uses
elements and attributes of any XML schema. Namespaces are numbered in the
\xmlnstbl table.
<xmltagopen> '{\*' \xmlopen \xmlnsN <xmltagtype> <xmltagname> <xmlattr>* '}'
<xmltagtype> \xmlsdttunknown | \xmlsdttregular | \xmlsdttpara | \xmlsdttcell | \xmlsdttrow
<xmltagname> '{' \xmlname #PCDATA '}'
<xmlattr> '{' \xmlattr \xmlattrnsN <xmlattrname> <xmlattrvalue> '}'
<xmlattrname> \xmlattrname #PCDATA
<xmlattrvalue> \xmlattrvalue #PCDATA
<xmltagclose> '{\*' \xmlclose '}'
<smarttagopen> '{\*' \xmlopen \xmlnsN <smarttagname> <xmlattr>* '}'
<smarttagname> '{' \factoidname #PCDATA '}'
| Control word | Meaning |
|---|---|
\*\xmlopen | Start of an XML element (or smart tag). |
\*\xmlclose | End of the element. |
\xmlnsN | Its namespace: entry N of the namespace table. |
\xmlname | Its name. |
\xmlattr | An attribute, with \xmlattrnsN (namespace), \xmlattrname and \xmlattrvalue. |
\xmlsdttregular | The element holds runs, not paragraphs, cells or rows. |
\xmlsdttpara, \xmlsdttcell, \xmlsdttrow | The element encloses a paragraph, a table cell or a table row. |
\xmlsdttunknown | Unknown type. |
\factoidname | The name of a smart tag. |
{\*\xmlopen\xmlns2{\factoidname date} {\xmlattr\xmlattrns0{\xmlattrname Month}{\xmlattrvalue 4}}
{\xmlattr\xmlattrns0{\xmlattrname Day}{\xmlattrvalue 11}} {\xmlattr\xmlattrns0{\xmlattrname
Year}{\xmlattrvalue 2006}}}4/11/2006} {\*\xmlclose}
A date smart tag, from the specification. All these words are flagged 2007.
Custom XML data
{\*\datastore #SDATA} (2007) holds the document’s custom XML parts
(Office Open XML datastoreItem). On Windows the parts are written to an
IStorage stamped with CLSID_SAXXMLReader50, flattened with
OleConvertIStorageToOLESTREAM and hex-encoded; other platforms use
equivalent functions. RTF does not define the format of the flattened data.
Source: Microsoft, Rich Text Format (RTF) Specification, version 1.9.1, 19 March 2008, sections “Comments (Annotations)”, “Move Bookmarks”, “Protection Exceptions”, “Custom XML Tags”, “SmartTag Data”, “Custom XML Data Properties” and Appendix B; the PDF copy Microsoft keeps for its Open Specifications.