3 4
A field lets Word know that there's additional information you want to include, or an action you want to perform, in a document. You add a field by choosing Insert, Field. The Field dialog box opens so that you can make your choices about the particular field and options you want to use. (See Figure 36-1.)
Figure 36-1. You insert a field by using the Field dialog box.
Field Anatomy
When you make the selections for the field, Word inserts a field code in the document at the insertion point. This is the code that tells Word what to insert or what action to call for when the user is working with the document. A field code like the following one includes four basic elements:
{ DATE \@ "dddd, MMMM dd, yyyy" \* MERGEFORMAT }
- Field identifiers. The curly braces { } are inserted when you create the Field using the Field dialog box or press Ctrl+F9 to insert a field.
- Field name. The name of the field, in this case DATE, is the field you select or type between the braces.
- Field instructions. The instructions, here shown as "dddd, MMMM dd, yyyy," include any text you want to display as a prompt, a value or phrase, or a bookmark to be inserted.
- Switches. A switch, shown in this example as MERGEFORMAT, is an option you set to specify the way in which you want the field to be displayed or formatted.
Field Functions
Fields have three basic functions in Word. You might use a field to perform a certain kind of action, to mark a specific item, or to display the results of a calculation.
- Action fields. An action field asks for action from the user. Examples of fields include the ASK field and the FILL-IN field, which prompt the user to enter more information.
- Marker fields. A marker field is a field that marks an item for a specific purpose. For example, when you identify a word or phrase to be included in an index, Word inserts a field code to mark the index entry.
- Result fields. A result field, as you might expect, displays the results or a calculation or a file retrieval operation. One of the most common result fields you'll use is the Formula field; you'll also use Date and Time, as well as AutoText, to display results in the field.
Fields You're Already Using
For some procedures, Word adds fields behind the scenes. When you create a table of contents, for example, Word adds {TOC} codes in your document. When you create an index, Word adds the index entry {XE} codes as field codes. Other examples of field codes that might be in your document include these:
- A bookmark you've inserted is placed in your document as a {BOOKMARK} field code.
- If you've used Insert, Date And Time to add the current date, the {DATE} code is placed in your document.
- If you've added a page number, {PAGE} is already in your document.
- If you've added a hyperlink to a URL or another document, {HYPERLINK} is in your document.
- A footnote you've added shows up as {NOTEREF} in the document.