Understanding Fields

A field is a set of instructions that you place in a document. Most often, these instructions tell Word to find or produce some specific text and place that text where you have inserted the field. In other cases, fields may be used to mark text, such as index entries, which you want Word to keep track of. In a few cases, Word fields can also tell Word to take an action that doesn't place new visible text in your document, such as running a macro that saves a file.

Using fields, you can delegate many details of assembling a document to your computer. For instance, suppose that your document contains figures and tables that need to be numbered consecutively. You can do this manually?and redo the numbering every time you insert or delete a figure or table. Or you can use a field code and let Word track it all for you.

Word disguises many of its field codes behind friendly dialog boxes. For example, when you insert a cross-reference, numbered caption, or table of contents?or tell Word to insert a date and time that can be updated automatically?you're inserting a field code. In fact, Word 2003 goes beyond any previous version of Word in helping users gain the benefits of fields without understanding the underlying codes themselves.

This chapter shows you exactly what can be accomplished using Word 2003's field tools. But you'll also get acquainted with the underlying field codes themselves, for two important reasons. First, you can still do many things by editing field codes that Word hasn't yet built into neat and clean dialog boxes. Second, if you need to enter many fields in your document, or troubleshoot fields you've entered or inherited, you'll be far more effective if you understand how they really work.

Fields come in several categories:

  • Result fields give Word instructions about what text to insert in your document.

  • Marker fields mark text so that Word can find it later?for example, to compile into an index or a table of contents.

  • Action fields take a specific action?for example, to run a macro.

Each of these categories is covered next.

What Result Fields Do

Fields that specify instructions that Word can use to determine which text to insert in your document are called result fields, and the information they generate is called field results. These field results can come from many sources, including the following:

  • Information stored in the document's Properties dialog box, such as the author's name, or keywords you may have specified

  • Information Word calculates from sources you specify, such as adding a column of numbers

  • Information Word requests later

  • Information Word produces based on what it finds in your document (such as page counts)

  • Information found in other files

  • Information found elsewhere in your document

Because your document stores the field instructions, not the actual information, Word can update the field results with new information whenever a change in your document calls for it. That's the magic of field codes?they handle details you might easily forget.

graphics/trouble_icon.jpg

If Word is failing to update fields properly, see "What to Do When a Field Won't Update Properly," in the "Troubleshooting" section of this chapter.


What Marker Fields Do

Some fields simply mark text so that you (or another field you've inserted in your document) can find it later. For example, the TC field marks entries that later can be compiled into tables of contents; similarly, the XE field marks index entries that can be compiled into indexes.

What Action Fields Do

Finally, some action fields tell Word to perform a specific action that doesn't place new visible text in your document. For example, when you click on a { HYPERLINK } field, Word jumps to the location indicated in that field. Similarly, the { MACROBUTTON } field places a button in the text. When you click it, Word runs a macro you've specified in your field code.



    Part I: Word Basics: Get Productive Fast
    Part II: Building Slicker Documents Faster
    Part III: The Visual Word: Making Documents Look Great
    Part IV: Industrial-Strength Document Production Techniques
    Part VI: The Corporate Word