- What Are Field Codes?
- Where Would I Use Fields?
- Entering Fields
- What Does a Field Code Look Like?
- Updating Fields
- Where Should You Begin?
- Points To Keep in Mind
What Does a Field Code Look Like?
When you insert a field, in your document you see by default the value of the field, not the field code itself. To see the codeor, more accurately, to toggle between code and resultsyou can right-click the field and click Toggle Field Codes. The field results will disappear and the code will appear (or vice versa).
Let's look at an example. Suppose you typed the following line in your document:
This document is written by .
You then position the insertion point before the period at the end of the line and choose Insert, Field. In the Field dialog box (shown in Figure 1), you select the Author field and click OK to insert the field.
Presuming that your name is the same as mine, here's what you'll see in your document:
This document is written by Laurie Rowell.
When you click Toggle Field Codes, the same line will look like this:
This document is written by { AUTHOR \* MERGEFORMAT }.
TIP
To toggle all the fields in the document between code and result, press Alt+F9.
The field result cannot effectively be changed. That is, I couldn't put my cursor in the text between Laurie and Rowell and type my middle name. Well, actually, I could do that, but it would be ineffective because the moment the document's fields were updated, the result of the field would revert to what I had before. Why? Because the field code tells Word to get the author information from the document's properties list, which you can display by choosing File, Properties from the menu (see Figure 2). If I wanted to add my middle name for this document, I could just change the default settings on the Summary tab. Then I would need to update the field, as described in the next section.
There are some options for editing fields:
I could highlight the field, right-click, and then click Edit Field to make changes in the Field dialog box, but that would only let me change the field itself, not the contents.
If I wanted to make changes to the way the field values appeared in my documentfor example, displaying a date as mm/dd/yyyy instead of mm/dd/yyI could toggle the field to display the code and edit the code inline.