When you insert a field in your document it stores as a field code
, a special set of instructions that tells Word what to display. Usually what you see is the field’s result, the value that Word creates by evaluating the field code. For example, the {DATE \@ "M/d/yyyy"}
field code is used to display the current date on the document.
To insert date field, click Insert
tab, choose Date & Time
from the Text
group, choose a date format from the Date and Time
dialog box, make sure the Update Automatically
box is check, and click OK
to insert the date. Press Alt+F9
to see date-field code. If you want to see field result instead of code, press Alt+F9
again:
Field dialog box
There are several ways to insert fields into a document, but the Field
dialog box provides more types of fields. Click Insert
tab, in the Text
group, click Quick Parts
and then click Field
to open the dialog box:
Insert a field with keyboard
A field code consists of:
- Field markers
{}
: The entire field code is enclosed in a pair of field markers. PressCtrl+F9
to insert a pair of field markers. - Field name.
- Instructions, such as a formula.
- Switches (optional), to modify or format the field’s result
To manually write the field code, click in your document where you want the field result to appear. Press Ctrl+F9
to insert a pair of field markers. Type the field code between the markers, including any text and switches that are needed to produce the code result that you want.
For example, to insert the date field manually:
- Press
Ctrl+F9
to insert field markers - Write
DATE
inside the field marks - Click
Update Field
button which appears on top of the field marks (or pressF9
keyboard button):
- After updating the field, code disappears and you can see the result of the field code (the current date).
Toggle field codes
To show or hide field codes for the entire document:
- Press
Alt+F9
to display all the field codes. - Press
Alt+F9
again to redisplay all the field results.
To show or hide field code for a selection or specific field:
- Press
Shift+F9
to display the field codes for a selection. - Press
Shift+F9
again to redisplay the field results for a selection.
Use mouse to toggle field code
Right-click the selection, and then in the shortcut menu that appears, click Toggle Field Codes
to display the field codes of only the fields within the selected text:
Field Switches
You can control the appearance of fields that produce numbers, dates, or text as their field results by using optional switches that modify the result in the way that you specify. The insert the date field manually example inserts the date in Word’s default format. If you want to specify a date format other than the default form, or the format you want to use is not available in Field
dialog box, you need to use the Switches.
Press Alt+F9
to manually edit the date field, or open the Field
dialog box (Insert > Quick Parts > Field
), select Date
and click Field Codes
:
Write field code to format the date field, for example, the DATE \@ "dddd, MMMM d"
code displays Thursday, January 14:
Click the Options
button to see the available switches for the Date field:
The Field Specific Switches:
More Fields Tutorials: