Word Add Chapter Title to Header?
In this article
Yes, you can automatically add a chapter title to the header in Microsoft Word by using a field code that references the built-in Heading 1 style. This way, each page’s header shows the current chapter’s title, and it updates automatically when you edit or add headings.
Background: Why Use a Dynamic Header?
Manually typing a chapter title into each header works only for short documents. In a long thesis, manual, or book-length report, you would have to update every header whenever a chapter title changes or a new chapter is inserted. A dynamic field pulls the text from the heading itself, so the header stays synchronized with your document. This is especially useful for:
- Books and dissertations with many chapters
- Technical manuals where section names change during revision
- Reports that are assembled from multiple files
Word’s built-in field code STYLEREF is the tool for this job. It was designed exactly to retrieve the text of a paragraph that uses a specified style, making it the standard solution for “running headers” that show the current section or chapter.
How It Works: The STYLEREF Field
The STYLEREF field inserts the text of the nearest preceding (or following) paragraph that has a particular style. For a chapter title, you would reference the Heading 1 style. When you place the field in the header, Word looks up the current page and finds the most recent Heading 1 paragraph before that page. That text becomes the header content.
Here’s the exact field code:
{ STYLEREF "Heading 1" }
You don’t type the braces manually. Instead, you insert the field via the Insert tab or use the keyboard shortcut Ctrl+F9 to create empty field braces, then type the code inside.
How to Insert the Chapter Title Field
Follow these steps for Word 2016, 2019, 2021, and Microsoft 365 (Windows and Mac versions are similar):
- Double-click inside the header area of any page to open the header.
- Place your cursor where you want the chapter title to appear.
- Press Ctrl+F9 (Windows) or Cmd+F9 (Mac) to insert a pair of field braces:
{ }. - Type inside the braces:
STYLEREF "Heading 1"(including the quotes). - Press F9 (or right-click and choose Update Field) to display the result.
- Click Close Header and Footer (or double-click outside the header).
If you prefer not to use field braces manually, you can also go to Insert > Quick Parts > Field, choose StyleRef in the Field names list, select Heading 1 in the Style name list, and click OK.
Customizing Which Heading Level to Use
If your document uses Heading 2 for sections and Heading 1 for chapters, you might want the header to show the section title instead. Simply replace "Heading 1" with "Heading 2" in the field code. You can also mix levels: for example, put the chapter title on the left and the section title on the right by inserting two separate STYLEREF fields with different style names.
One common customization is to include the chapter number along with the title. If your headings are numbered (e.g., “Chapter 3: Results”), the STYLEREF field will include that number because it is part of the heading text. If you want only the number or only the title, you would need to use separate fields or a different approach, such as the SEQ field for numbering.
Common Problems and How to Fix Them
Several issues can arise when using STYLEREF in headers:
- Header shows the wrong chapter. This usually happens when the heading style is not applied correctly. Make sure your chapter titles are formatted with the built-in Heading 1 style, not just manually bolded text.
- Header is blank. If the field returns nothing, the style name might be misspelled in the field code. Check for extra spaces or wrong capitalization.
- Header doesn’t update after editing. Fields update when you print, switch to Print Preview, or press F9. To force an update, select the header and press F9, or use Ctrl+A then F9 to update all fields in the document.
- Header shows the next chapter instead of the current one. By default, STYLEREF looks backward (previous heading). If you want it to look forward, add the
\nswitch:{ STYLEREF "Heading 1" \n }.
Comparing STYLEREF with Other Methods
There are other ways to get chapter titles into headers, but they have drawbacks:
- Manual typing: Quick but requires updating every header by hand if titles change.
- Cross-reference field: Can reference a bookmark or heading, but you must insert a bookmark for each chapter and update the reference manually.
- STYLEREF: Fully automatic, works with any heading style, and updates with the document structure. It is the most efficient for long documents.
For most users, STYLEREF is the best balance of simplicity and automation.
Tips for Multi-Section Documents
If your document uses multiple sections (e.g., different headers for front matter and main text), you need to unlink the headers between sections. By default, headers are linked to the previous section. To have a different header for each section, go to the header of a new section and click Link to Previous to turn it off. Then insert the STYLEREF field in that section’s header. This allows you to have, for example, no header in the front matter and a chapter header in the main body.
Frequently Asked Questions
Why does my header show the last chapter on every page?
This happens when the STYLEREF field is placed in a header that is linked to a section where the heading style is not present. For instance, if your first section has no Heading 1, the field may pick up the last Heading 1 from a previous section. Ensure each section has at least one heading, or unlink the header and insert a blank field for sections without chapters.
Can I show the chapter title in the footer instead?
Yes, the same STYLEREF field works in the footer. Just open the footer area and insert the field exactly as you would in the header.
Does this work with Word for Mac?
Yes, STYLEREF works in Word for Mac. The keyboard shortcut is Cmd+F9, and the field code syntax is identical.
How do I update all headers at once?
Press Ctrl+A to select the entire document, then press F9. This updates all fields, including those in headers and footers. Alternatively, go to File > Print, which forces Word to update fields before printing.
What if my chapter titles are not using the Heading 1 style?
You can modify the STYLEREF code to reference any style name, such as “Chapter Title” if you have a custom style. Just replace “Heading 1” with the exact name of your style, including the quotes.