How to Fix Word STYLEREF Headers Showing the Previous Chapter
Question details
The user needs to correct STYLEREF fields in Word headers that incorrectly display the previous chapter's heading instead of the current one, particularly when a new part begins with a long introduction.
- Product
- Word
- Device & OS
- not provided
- Scenario
- Formatting a long document, such as a doctoral thesis, with different odd and even headers that use STYLEREF fields to reference part and chapter headings.
- Observed behavior
- When a new part begins with a long introduction, the odd-page header erroneously displays the chapter name from the preceding part because STYLEREF looks backward to find the last applied heading style.
Ensure your document styles, such as Heading 1 and Heading 2, are accurately and consistently applied to your chapter titles before modifying the header field codes.
Use Bookmarks and REF Fields for Precise Header References
Replace the automatic STYLEREF field with a specific REF field linked to a bookmark, ensuring the header always references the correct chapter regardless of page distance.
STYLEREF searches for the nearest matching style and does not inherently understand part or chapter boundaries. Using a manual bookmark and REF field combination gives you absolute control over what is displayed in the header.
Select the text of your current chapter heading in the document body. Go to the Insert tab, click on 'Bookmark', name it (e.g., 'Chapter2'), and click 'Add'.
Double-click the top margin of your document page to open the Header & Footer editing mode.
Delete the problematic STYLEREF field. Navigate to Insert > Quick Parts > Field. Select 'Ref' from the field names list, choose your newly created bookmark, and click OK.

Apply a Dedicated Character Style to Headings
Create and apply a specific character style to the text you want to appear in the header, then instruct STYLEREF to look for that character style instead of a paragraph style.
Verify Applied Styles using Reveal Formatting
Check if the correct Heading styles are actually applied to the text, as STYLEREF relies entirely on exact style matches to populate the header.
Easily Format Thesis Headers with WPS Office
WPS Writer provides robust styling and field insertion tools, making it exceptionally easy to manage complex document headers, bookmarks, and cross-references for your thesis or dissertation.
- 1. Open your Document: Launch WPS Writer and open your thesis or dissertation document.
- 2. Create a Bookmark: Highlight your chapter title, navigate to the Insert tab, and select Bookmark to securely tag the heading.
- 3. Insert Field in Header: Double-click the header space, go to Insert > Field, and choose the REF field pointing to your bookmark to guarantee accurate chapter display on every page.

Frequently Asked Questions
Why does my STYLEREF field show the wrong chapter name?
STYLEREF searches the current page from top to bottom. If it doesn't find the specified style (like Heading 2), it looks backward to previous pages. If a new part has a long introduction without a Heading 2, the header will inevitably display the last Heading 2 it found from the previous chapter.
How can I force STYLEREF to search from the bottom of the page upwards?
You can add the '\l' switch to your STYLEREF field code (e.g., { STYLEREF "Heading 1" \l }). This forces the processor to search from the bottom of the page to the top, which is particularly useful for dictionary-style headers where you want to show the last item on the page.
Can I use STYLEREF with character styles instead of paragraph styles?
Yes. Creating a custom character style and applying it only to specific words allows STYLEREF to reference just that selected text. This provides granular control over what appears in your header, bypassing issues with entire paragraph styles spanning across unintended areas.




