By using the STYLEREF field in a header, you can print at the top of each page the first and last items that appear on that page ù for example, the first and last names that appear on a page in a membership directory.
Format the names in the document by using a paragraph or character style.
Insert two STYLEREF fields in the document header.
How?
For more information about a specific field or option, click the question mark , and then click the option.
Notes
If you cannot see the codes for a particular field in the Field dialog box, click Field Codes.
To nest a field within another field, first insert the outer, or "container" field, using the Field dialog box. In your document, place the insertion point inside the field code where you want to insert the inner field. Then use the Field dialog box to insert the inner field.
Tip
If you know the field code for the field you want to insert, you can also type it directly in your document. First press CTRL+F9, and then type the code within the brackets.
The first field should contain the STYLEREF field and the style of the items on the page ù for example, {STYLEREF "HEADING 1"}. The second field should contain the STYLEREF field, the style of the items on the page, and an \l switch ù for example, {STYLEREF "HEADING 1" \l}. The \l switch instructs the field to search from the bottom of the page to find the first text formatted with the style you entered in the field.
Learn
more about the effects of the STYLEREF field location
Where you insert the STYLEREF field determines the direction that Microsoft Word searches in for the style and thus can affect which text is inserted.
When you insert the field in:
Document text
Word searches for the closest text preceding the STYLEREF field. If the style isn't found, Word searches for the closest following text.
Footnotes, annotations, and endnotes
Word searches for the closest text preceding the footnote, annotation, or endnote reference mark in the document text. If the style isn't found, Word searches for the closest text following the reference mark.
Headers and footers (during printing)
If the \l switch is used, Word searches from the bottom of the page to the beginning and then the end of the document.
Headers and footers (when not printing)
Word searches for the section that contains the STYLEREF field, from the beginning. If the style isn't found, Word searches from the end of the section to the end of the document.
When you print the document, the first and last names on each page appear in the header on that page.