A StyleRef field can make a Word header display a chapter title, section heading, or other text formatted with a chosen style. This guide covers how to insert the field, control which heading appears, keep it updated, and troubleshoot common problems. It is for anyone preparing a long report, thesis, manual, or book who wants running headers that follow the document instead of needing manual edits.
1. Understand What a StyleRef Field Does
STYLEREF is a Word field that finds text formatted with a specified paragraph or character style and displays that text in the document. In a header, it is commonly used to show a chapter or section heading on the pages that belong to it, so the header changes as the reader moves through the document. The field displays matching text; it does not create a heading or apply a style to one, so the source text must already have the formatting you want Word to find.
2. Format Source Headings with Built-In Styles
Apply Word’s built-in Heading 1, Heading 2, or another consistent heading style to the text you want the header to pick up. For example, a report might use Heading 1 for chapter names and Heading 2 for subsections, letting the header show the chapter while the body contains more detailed subheadings. You can change a heading style’s font, size, and spacing without losing its identity as Heading 1, which is more reliable than selecting text and formatting it manually.
3. Insert the Field in the Header Area
Open the header by choosing Insert > Header and selecting a layout, or double-clicking the top margin of a page. In Word for Windows, press Ctrl+F9 to insert the special field braces, then type STYLEREF followed by the style name in quotation marks, such as STYLEREF "Heading 1"; do not type ordinary braces yourself because Word will treat them as text. On other versions, use the Field or Quick Parts interface if available, or check the keyboard shortcut for your platform.
4. Choose the Exact Style Name
The name in the field must identify the style applied to the source text, so STYLEREF "Heading 1" will not find a heading formatted only with a custom style called Chapter Title. Use the style name as it appears in Word’s Styles pane; quotation marks are especially useful when the name contains spaces. If a custom style is renamed, check the field afterward, since a field referring to the old name may no longer return the intended text.
5. Decide Which Heading on a Page Should Appear
By default, STYLEREF searches for the first matching styled text on the page, which often suits a chapter header when the chapter title is near the top. Add the \l switch to search from the bottom of the page and display the last matching text instead: STYLEREF "Heading 2" \l can be useful when a page contains several subsection headings and the running header should reflect the final one. Test pages with multiple matching headings, because the choice affects what readers see in the header.
6. Use Heading Levels to Control the Header Hierarchy
A document can use different levels for different running-header needs: Heading 1 can identify a chapter, while Heading 2 can identify a subsection. Put the field for the appropriate style in the header, rather than expecting one field to combine multiple heading levels automatically. If you want both chapter and subsection context, place two fields with suitable punctuation between them, and test pages where one level changes but the other does not.
7. Insert and Refresh the Field Correctly
After entering the code, select the field and press F9 to update its displayed result; Alt+F9 switches between field codes and results in many Windows Word setups. A field may show its code rather than the heading, or show an old result, until it is updated. Word can update fields when printing if that option is enabled, but do not rely on that for review: update the fields before sharing or exporting, and check the final PDF as well.
8. Check Sections and Different Header Options
Headers belong to document sections, and a new section can have its own header settings. If Link to Previous is enabled, the header is connected to the preceding section; turning it off lets you create a different header, but also means you may need to add the StyleRef field to that section separately. Also check Different First Page and Different Odd & Even Pages: these settings create distinct header areas, so a field placed in one may not appear in the others.
9. Troubleshoot a Blank or Unexpected Result
If the header is blank, confirm that matching text is styled with the exact style named in the field and that the field is in the intended section’s header. A page with no matching heading may display a heading carried from an adjacent page, depending on Word’s search behavior, so inspect the pages around section breaks and heading changes rather than judging from one page alone. If the wrong heading appears, check whether more than one matching style occurs on the page and whether the \l switch is appropriate.
10. Use StyleRef for Other Repeating Labels
STYLEREF is not limited to chapter titles: it can display text formatted with a custom style, such as a legal document’s case-name style or a manual’s procedure heading. It can also be used in places beyond headers, including footers and body text, whenever a changing reference to styled content is useful. The field only retrieves styled text, however; for page numbers, dates, or automatic numbering, use the relevant Word field or numbering feature instead of expecting STYLEREF to supply that information.
How to Choose
Start by deciding what the reader needs to identify on each page. For a book or long report, Heading 1 is often the right source when the header should show the current chapter; for a technical guide, Heading 2 may be more useful if readers navigate by subsections. Then consider how many matching headings can occur on a page: the default first match suits many chapter layouts, while \l can make sense when the last matching subsection is the better locator.
Next, consider the document’s structure and maintenance. Built-in heading styles work well when the document already uses Word’s outline hierarchy, while a clearly named custom style can suit specialized labels as long as it is applied consistently. Finally, check section boundaries, first-page headers, and odd/even headers before settling on a setup. A field is only dependable if it is present in the relevant header variants and its source headings use the intended style throughout.
Frequently Asked Questions
Can I type the field braces using the keyboard?
In Word for Windows, use Ctrl+F9 to insert field braces, then type the field code between them. Braces typed as ordinary characters are not recognized as a Word field.
Can StyleRef show a custom style?
Yes. Use the exact custom style name in the field, such as STYLEREF "Chapter Title", and apply that style to the text you want displayed.
Why does the header show a heading from another page?
When Word cannot find a matching style on the current page, it can use a nearby matching occurrence in its search. Check the pages around the result, the field’s style name, and whether the source heading is actually on the page you expect.
How do I make the header show the last heading on a page?
Add the \l switch after the style name, as in STYLEREF "Heading 2" \l. Update the field and test a page with more than one Heading 2 paragraph.
Will the field update automatically?
Word updates fields in some situations, such as when printing if the relevant setting is enabled, but the displayed result can remain stale during editing. Update it with F9 and review the document before distributing it.
Final Thoughts
A StyleRef field is a practical way to keep running headers connected to the headings in a Word document. Use consistent styles, choose the heading level and search direction deliberately, and test every section and header variant. Those checks make the field far easier to trust in a long document than a header typed by hand.