How to Show Only the First Heading on a Page in a Word Running Header
Question details
The user wants to configure a running header in Word to selectively display only the first occurrence of a specific heading on a page, bypassing the default STYLEREF behavior when multiple identical styles exist.
- Product
- Word
- Device & OS
- not provided
- Scenario
- Setting up complex document layouts where a running header needs to reference a specific heading, but the page contains multiple paragraphs using the same heading style.
- Observed behavior
- The standard STYLEREF field automatically picks up the first instance of a style on a page. There is no simple built-in setting to restrict it to only the specific heading paragraph desired if multiple paragraphs share the same style on the same page.
Ensure your document headings are properly styled and that you have enabled formatting marks (Show/Hide ¶) so you can clearly see where your styles are applied before adjusting the running headers.
Use a Dedicated Character Style with STYLEREF
By creating an invisible character style and applying it only to the specific text you want in the header, you can force the STYLEREF field to target exactly what you need.
A Word STYLEREF field follows its style-based rules and defaults to the first matching style on a page. By using a custom Character Style instead of a Paragraph Style, you isolate the exact text to reference without altering the document's visual formatting.
Open the Styles pane (Alt+Ctrl+Shift+S) and click 'New Style'. Name it 'HeaderReference', change the 'Style type' to 'Character', and ensure it is based on 'Underlying Properties' so it makes no visual formatting changes.
Highlight only the text of the first heading on the page that you want to appear in the running header, and apply your newly created 'HeaderReference' character style.
Double-click the header area. Go to Insert > Quick Parts > Field. Select STYLEREF from the list, choose your 'HeaderReference' style, and click OK.

Insert a Cross-Reference to a Specific Heading
If you only have a few chapters or specific headings you want to display, a static cross-reference is a reliable alternative to dynamic fields.
Master Complex Headers with WPS Writer
WPS Writer fully supports advanced field codes like STYLEREF and cross-referencing. You can easily manage running headers, custom character styles, and professional page layouts with its intuitive interface.
- 1. Open Document: Launch WPS Writer and open your document containing the headings.
- 2. Create Character Style: Open the Styles and Formatting task pane, create a new Character style, and apply it to your target heading text.
- 3. Edit Header: Double-click the header area to activate the Header and Footer editing mode.
- 4. Insert Field: Go to the Insert tab, select 'Field', find the STYLEREF field, and link it to your custom Character style.

Frequently Asked Questions
Why is my STYLEREF field showing the heading from the previous page?
If there is no matching style on the current page, the STYLEREF field automatically displays the text from the last matching style on previous pages. It essentially looks backward to find the most recent application of the referenced style.
How do I update a STYLEREF field after editing the heading?
To update the field, select the header text (or press Ctrl+A while inside the header), and press F9. Alternatively, you can right-click the field and select 'Update Field'.
Can I make the STYLEREF field search from the bottom of the page up?
Yes. You can add the \l switch to the STYLEREF field code (for example, { STYLEREF "Heading 1" \l }) to instruct the word processor to search from the bottom of the page instead of the top.
Does WPS Writer support the STYLEREF field code?
Yes, WPS Writer is highly compatible with Word field codes, including STYLEREF. You can use the exact same methods, such as applying character styles and inserting fields, to achieve the same running header results.




