How to Use the First Heading Only in a Word Running Header
Question details
The user wants to configure a running header using STYLEREF or Quick Parts so that it only picks up the very first matching heading on each page, especially when multiple headings of the same style exist.
- Product
- Microsoft Word / WPS Writer
- Device & OS
- not provided
- Scenario
- Creating professional documents where running headers need to dynamically display the first heading of a page without duplicating or selecting the wrong heading.
- Observed behavior
- The STYLEREF field normally picks the first instance of a style on a page, but the software lacks a simple built-in setting to strictly isolate a specific heading when styles repeat unexpectedly.
Ensure your document headings are properly formatted using built-in heading styles (like Heading 1 or Heading 2) and make the header area accessible by double-clicking the top margin of your page.
Use a Custom Character Style with STYLEREF
Since there is no native toggle for this exact behavior, applying a unique character style to the target heading and referencing it ensures the header only picks up the desired text.
A STYLEREF field normally uses the first instance of the specified style on the page. By creating a character style that does not alter text appearance and selectively applying it to the exact heading you want, you can force the STYLEREF field to target only that text.
Open the Styles pane and click 'New Style'. Name it something recognizable like 'HeaderRef'. Change the 'Style type' to 'Character' and leave all formatting options as default so it won't change your text's appearance.
Select the specific heading text on your page that you want to appear in the header. Click on your newly created 'HeaderRef' character style to apply it to this text only.
Double-click the top of the page to open the Header area. Navigate to Insert > Quick Parts > Field. In the Field names list, select 'StyleRef', then choose 'HeaderRef' from the Style name list, and click OK.
Insert a Direct Cross-Reference in the Header
If your document has a fixed structure, you can manually cross-reference the specific heading you want to display on that page.
Manage Headers and Styles Seamlessly in WPS Writer
WPS Writer offers full support for advanced field codes, including STYLEREF, allowing you to create dynamic and professional running headers with ease. It is fully compatible with Microsoft Word formats and features a highly intuitive style manager.
- 1. Open document and format headings: Launch WPS Writer, open your document, and ensure your standard heading styles are applied.
- 2. Create a character style: Go to the 'Home' tab, open the Styles pane, and create a custom character style for the target heading text.
- 3. Insert the STYLEREF field: Double-click the header to edit it, go to the 'Insert' tab, select 'Field', choose 'StyleRef', and pick your custom character style.

Frequently Asked Questions
Why does STYLEREF pick up the wrong heading on my page?
By default, STYLEREF searches for the first instance of the specified style from top to bottom on the current page. If you have multiple paragraphs or words tagged with the same style, it will grab the first one it encounters.
Can I make STYLEREF search from the bottom of the page instead?
Yes, you can add the \l switch to the STYLEREF field code (e.g., { STYLEREF "Heading 1" \l }). This switch forces the software to search from the bottom of the page upwards, effectively selecting the last heading on the page.
Will the character style workaround change the look of my headings?
No. When creating the character style, you can base it on the underlying paragraph style and leave all formatting options blank. It will act purely as an invisible tag for the STYLEREF field to target.
Do cross-references in headers update automatically?
Cross-references and field codes do not always update in real-time as you type. You typically need to select the text (or press Ctrl+A) and press F9, or enter Print Preview mode, to force the fields to update when pagination or heading text changes.




