• No results found

Manage fields and their properties

As described earlier in this chapter, Word uses fields to manage elements such as indexes and tables of contents. Later in this section, you’ll work with merge fields, which are used to specify information included in a mail merge.

In cases like these, Word inserts fields and sets field properties based on options you select in the user interface. You can also insert fields on your own to display informa-tion or to control how elements such as a table of contents appears.

The Field dialog box lists fields in categories such as Date And Time, Document Automation, Document Information, Links And References, and User Information. Fields that display document properties, such as author, keywords, and title, are listed in the Document Information category. You can display all fields or only the fields in a particular category.

Set up a field by using the properties and options Word provides

Objective group 3 Create advanced references Objective group 3 Create advanced references

When you select a field in the Field dialog box, a list of the field’s properties is displayed.

Field properties often control formatting—for example, whether the text displayed by a field is in all uppercase characters or which numbering or date format a field’s data will use. Field properties also identify information such as which style to associate with the StyleRef field or the data source that’s linked to the Database field.

Clicking the Field Codes button changes the display in the dialog box so that you see the field code. The field code includes the field’s name (such as FileSize) and can also include properties and other switches that affect how the field’s data is formatted and what the field displays. (The term switch refers generally to both field properties and options.) For example, the field code {FILESIZE \* CardNumber \k \* MERGEFORMAT}

shows a document’s file size as a cardinal number in kilobytes. The MERGEFORMAT switch indicates that the field’s format remains the same when it is updated.

In a document, you can view the output of the field or the field code itself. When the information displayed in a field changes, you can update the field so that it’s current.

Word also provides keyboard shortcuts you can use to manage fields in a document, as shown in the following table.

Keyboard shortcut Action

Ctrl+F9 Inserts a blank field

Alt+F9 Switches the view between field codes and

field output for all fields in the document

Shift+F9 Switches the view between field codes and

field output for selected fields

F9 Updates selected fields

F11 or Shift+F11 Moves to the next or previous field

Ctrl+F11 Locks a field and prevents it from being

updated

Ctrl+Shift+F11 Unlocks a field

Tip Click the Help button in the Field dialog box to display a support page that provides a reference of field codes, properties, and options.

The Field dialog box provides access to the properties that control what information a field displays and how the field displays it. For document information fields such as Author, Keywords, and Title, you can select the Uppercase, Lowercase, First Capital, or Title Case property to specify how the text displayed by these fields appears. In the

Objective 3.3: Manage forms, fields, and mail-merge operations Objective 3.3: Manage forms, fields, and mail-merge operations

3

category Links And References, the properties for the StyleRef field is the list of styles in the document. You select the style that’s associated with the text you want the field to display (a section heading in a document’s footer, for example).

Selecting a property in the Field Properties area of the Field dialog box adds that prop-erty to the field code. You can modify the properties used with a field by displaying the field code and then opening the Field Options dialog box. Depending on the field you are working with, the Field Options dialog box provides a list of formatting options, gen-eral switches (which are also often related to the format in which a field displays data), and any field-specific switches (which are not included for every field). Keep in mind that some properties are not compatible with all fields or with other properties that field includes. You cannot, for example, apply a number format to text or add properties for two date formats to a single instance of a field.

Use general and field-specific switches to modify a field’s data and format

After you insert a field in a document, you can modify its properties by opening the Field dialog box from the menu displayed when you right-click the field.

Objective group 3 Create advanced references Objective group 3 Create advanced references

To insert a field

1. On the Insert tab, in the Text group, click Quick Parts, and then click Field.

2. In the Field dialog box, select the field you want to insert. Use the Categories list to view a subset of the fields.

3. In the Field properties area, select properties to format the field’s data or to identify the source (such as a style name, a file name, or an image file) for the field’s data.

4. In the Field options area, select the options you want to use with the field.

5. To view the elements of the field code, click Field Codes.

6. Click Options to open the Field Options dialog box, and then select the proper-ties and switches you want to apply.

7. Click OK in the Field Options dialog box, and then click OK in the Field dialog box.

To modify field properties

1. In the Field dialog box, filter by category if necessary, and then in the Field names list, select the field you want to use.

2. If the property you want to apply is available in the Field properties area, click it. If the property isn’t available in the Field properties area, do the following:

a. Click the Field Codes button, and then click the Options button.

b. In the Field Options dialog box, select a property you want to apply to the field.

c. Click Add to Field, and then click OK.

To update a field

Select the field, and then press F9.