Print dictionary-style page headers

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.

  1. Format the names in the document by using a paragraph or character style.

  2. Insert two STYLEREF fields in the document header.

    How?

    1. Click where you want to insert the information.
    2. On the Insert menu, click Field.
    3. Click a category, and then click a field name.
    4. Select the options you want.

      For more information about a specific field or option, click the question mark , and then click the option.

    Notes

    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)

    Word searches for the current page, from top to bottom. 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 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.