Microsoft Office Tutorials and References
In Depth Information
Using Fields to Automate Documents
Using Fields to Automate Documents
A field is a specialized placeholder for document content. (Word fields are not the same as
data merge fields, as discussed earlier in this chapter. In fact, data merge fields are a type of
Word field.) Fields can update dynamically, and they can be used for a wide variety of
purposes. They can show variable data, such as the name of the document author, the number
of pages in a document, or the date the document was last printed. They can be used to
generate number sequences or even to perform numeric calculations. You can use fields to
include certain text based on conditions you specify. You can use fields to create buttons
that run macros or perform other actions, and you can use fields to enable an interactive
document (one that asks a question and then enters the answer into the document).
And we’re just scratching the surface. There’s much more you can do with fields, but
detailing it is beyond the scope of this topic. What we can do, however, is show you how to work
with fields in general. Armed with that knowledge, you should be able to start using fields
in your documents.
You’ve probably already used fields, possibly without knowing it. Many features of Word
that we discuss elsewhere in this topic (for example, tables of contents, indexes, date and
time, and document properties) are implemented with fields, but Word provides an
interface that shields you from having to work directly with fields in these cases. Knowing how
to work with fields empowers you to tweak those fields in ways that can’t be done through
the normal user interface.
Working with Field Codes
A field can be represented in either of two ways: a field code (the programming language,
if you will) or the field result (the output of the field code as normally displayed or printed
in a document). For example, this field code:
{Author}
might yield this field result:
Samantha Smith
To switch views between field codes and field results, press Alt+F9. Table 10-1 shows more
keyboard shortcuts for working with fields.
A field code looks like ordinary text between curly braces—but there’s nothing ordinary
about the braces. You must insert them using Ctrl+F9 or with the Field dialog box. The
text within those magic braces includes the field name and, in some cases, properties and
switches. For example, the field code { SEQ OrderNum \n \#"##0" \* MERGEFORMAT }
includes the field name (SEQ), a property (OrderNum), and switches (the rest).
Search JabSto ::




Custom Search