Fix a StyleRef Header Error in a Microsoft Word Book Template
Question details
Identify and fix the style reference behind an error in a book template header.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- A book template uses a StyleRef field in its header to display text from a styled paragraph, such as a chapter heading.
- Observed behavior
- The header displays “Error! No text of specified style in document” because Word cannot find text using the referenced style.
Open the document in Word and identify a chapter heading that should appear in the header. If the error appears only on preliminary or first pages, note which sections contain those pages.
Check the StyleRef field and apply the referenced style
Use this method when the header references a style that is missing or is not applied to the chapter headings.
Double-click the header, right-click the error, and select Toggle Field Codes. On Windows, you can also press Alt+F9 to display all field codes.
Read the style name in the STYLEREF field, such as { STYLEREF "Heading 1" }. Check the spelling and any field switches before making changes.
Select a chapter heading in the document body and choose the exact referenced paragraph style from Home > Styles. Repeat for the other chapter headings, or correct the field if it references the wrong style.
Right-click the field and select Update Field, or select it and press F9. Toggle the field code off to check the displayed result.

Adjust headers for first and preliminary pages
Use this method if the StyleRef header should not appear on a section's first page or in preliminary sections.
Edit Book Documents with WPS Writer
WPS Writer is a free, lightweight Office alternative with a familiar interface for editing book documents. Open Word files and continue working with styles and headers, while checking complex fields after migration.

Frequently Asked Questions
What does the StyleRef error mean in Word?
The field cannot find text using the style it references. Right-click the error and select Toggle Field Codes to see the style name, then check the chapter headings under Home > Styles.
How do I display all field codes in Word?
On Windows, press Alt+F9 to toggle all field codes. To inspect one field, right-click it and select Toggle Field Codes.
Why does the error appear on a preliminary page?
A preliminary page may be using a header intended for chapter pages before the expected styled heading is available. Check Different First Page and Link to Previous on the Header & Footer tab, as well as the document's section breaks.
Will a StyleRef field work the same way in WPS Writer?
WPS Writer can open Word DOCX files, but complex field behavior may differ. After opening the file, check the header and field results before relying on them.




