By using the STYLEREF field in a header (header and footer: A header, which can consist of text or graphics, appears at the top of every page in a section. A footer appears at the bottom of every page. Headers and footers often contain page numbers, chapter titles, dates, and author names.), you can display and print at the top of each page the first and last items that appear on that page. For example, you can display the first and last names that appear on a page in a membership directory.
- Format the names in the document by using a paragraph (paragraph style: A combination of character- and paragraph-formatting characteristics that are named and stored as a set. You can select a paragraph and use the style to apply all of the formatting characteristics to the paragraph at one time.) or character style (character style: A combination of any of the character formatting options identified by a style name.).
- Insert two STYLEREF fields in the document header.
- On the View menu, click Header and Footer.
- In the header, click where you want to insert the information.
- On the Insert menu, click Field.
- In the Categories box, click (All).
- In the Field names box, click StyleRef.
- In the Style name box, select the style you used to format the names.
Note If you don't see a list of style names, click Hide Codes at the bottom of the dialog box.
- Under Field options, select the options you want, but do not select the Search from bottom of page to top check box.
- Click OK.
- Type some text to indicate a range, such as "through" or a dash.
- Repeat steps 3 through 7 for the second field, except that in step 7, select the Search from bottom of page to top check box.
When you print the document, the first and last names on each page appear in the header on that page.
Where you insert the STYLEREF field determines the direction that Microsoft Word searches for the style (style: A combination of formatting characteristics, such as font, font size, and indentation, that you name and store as a set. When you apply a style, all of the formatting instructions in that style are applied at one time.) and thus affects which text is inserted.
When you insert the field in:
Headers and footers (results for printed document)
Word searches the current page, from top to bottom, for the specified style. If the style isn't found, Word searches next from the top of the page to the beginning of the document, and then from the bottom of the page to the end of the document.
If you select the Search from bottom of page to top check box, Word searches from the bottom of the page to the beginning and then the end of the document.
Headers and footers (results for electronic document)