WD: How to Use the STYLEREF Field in Microsoft WordLast reviewed: February 5, 1998Article ID: Q141994 |
The information in this article applies to:
SUMMARYThis article describes how to use the STYLEREF field. The STYLEREF field can be used to create a dictionary-style entries at the top of each page or to place the chapter title in the heading. This field is useful when you want text in the header to match what's typed on the page. The STYLEREF field is a specialized reference field designed to let you add information to a document, especially in the header or footer, automatically. The STYLEREF field consists of the field, the name of the style assigned to the text to be returned as the result of the field, and field switches.
{STYLEREF "StyleName"} {STYLEREF "StyleName" <switches>} NOTE: The name of the style must be enclosed in quotation marks.Word will search the page from top to bottom (by default) for the nearest paragraph formatted with the style specified in the STYLEREF field. Word will return that text in the location of the field as the result.
STYLEREF Field Switches\l - Inserts the last text formatted with the style on the current page instead of the first text formatted with this style. Word searches the page from bottom to top. The \l switch is available only in headers and footers.\n - Inserts any paragraph numbering from the referenced paragraph. For example, caption numbering is included if caption numbering has been applied to the paragraph.The STYLEREF field is most often used in headers and footers. The examples in the "Examples" section of this article illustrate the possible uses of the STYLEREF field.
How to Insert a STYLEREF FieldMethod 1: To Create a Field Using the Menus:
To view the field code you just inserted, press {ALT}+F9.
Method 2: To Create a Field Using Keystrokes:
EXAMPLES
Case 1--Using STYLEREF Fields in a Dictionary/GlossaryUse the STYLEREF field when creating a glossary to show the first and last glossary words on each page--the same format you'll find in a dictionary.
If the field codes resemble the following {STYLEREF "Heading 2"}--{STYLEREF "Heading 2" \l} the result of the field codes will be: Apple - Baseball (where Apple and Baseball have been formatted with Heading 2 style) Case 2--Chapter Title to Appear in the HeaderUse this format to insert the current chapter name as part of the header or footer.
If the field code resembles the following {STYLEREF "Heading 1"} the result of the field in the header will be: File Management (where File Management was the title of the chapter formatted with Heading 1 style) MORE INFORMATION
Effective Use of the STYLEREF fieldTo use the STYLEREF field effectively, you need to understand how Word determines which paragraph is the nearest one. That determination depends on where the STYLEREF field is and on whether the /l (the letter L) switch is being used.
If STYLEREF is here Word will search here ----------------------------------------------------------------------- Document Text From the field code to the beginning of the document and then from the field code to the end of the document. Footnotes, From the reference mark in the document to the Annotations, beginning of the document, and then from the and Endnotes reference mark to the end of the document. Headers and From the beginning of the current page to the end of Footers that page, and then from the end of the previous page to the beginning of the document, and then from the beginning of the following page to the end of the document. If the \l switch is used, Word searches from the end of the current page to the beginning of the document, and then from the beginning of the following page to the end of the document. REFERENCESFor more information about the STYLEREF field, click the Index tab in Microsoft Word 7.0 Help, type the following text
STYLEREFand then double-click the selected text to go to the "Field codes: StyleRef field" topic. In Microsoft Word 6.x, click the Search menu in Help and type
STYLEREFand then double-click the selected text to go to the "Field codes: StyleRef field" topic.
|
Additional query words:
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |