Office Settings & Configuration

Create Conditional Headers for Heading 1 Pages in Word

Steven ParkerSteven Parker Nov 22, 2026 868 views

Question details

Create a Word header that displays a colored rectangle and the Heading 1 text when a major section begins.

Create Conditional Headers for Heading 1 Pages in Word
Product
Microsoft Word
Device & OS
not provided
Scenario
A document has major sections marked with the Heading 1 style, and the user wants a distinctive header on the first page of each section.
Observed behavior
The desired header appears on each major section's first page and displays that section's Heading 1 text.
Before you start

Apply the built-in Heading 1 style to each major section title using Home > Styles. Identify where each section should begin, because this method adds a section break before each one.

Solution 1Recommended

Use section breaks and StyleRef fields in first-page headers

Use this workaround to display a rectangle and the current Heading 1 text on the first page of each major section.

A StyleRef field can display styled heading text, but Word does not automatically show or hide a header shape based on the presence of a Heading 1 paragraph. Section breaks and first-page headers provide manual control over where the design appears.

1
Start each major section

Place the cursor before each Heading 1 that starts a major section. Select Layout > Breaks > Next Page to insert a section break.

2
Enable the first-page header

Double-click the header on a section's first page. On the Header & Footer tab, select Different First Page.

3
Control header links

In the first-page header, turn off Header & Footer > Link to Previous if you need to change it independently. Repeat for each section; first-page and regular headers have separate links.

4
Insert the heading field

In the first-page header, select Insert > Quick Parts > Field. Choose StyleRef, select Heading 1 as the style, and select OK.

5
Add the rectangle

While editing the header, select Insert > Shapes > Rectangle and draw the shape. Use Shape Format to set its fill and position it alongside or behind the heading text.

6
Check the remaining headers

Open a later page's regular header and, if necessary, turn off Link to Previous before removing unwanted content. Repeat the setup for each section and select Close Header and Footer when finished.

Use section breaks and StyleRef fields in first-page headers
Check each section's first page: A StyleRef field can display a preceding heading if it does not find the intended heading on the page. Check the result after inserting breaks and changing the document layout.
Free Microsoft Office alternative

Edit Word Documents with WPS Writer

WPS Writer is a free, lightweight alternative for editing documents in a familiar interface. Open compatible Word files and continue working with headings, headers, and shapes as you move between office suites.

Edit document headings, headers, and shapes in WPS WriterCompatible with Microsoft Word DOC and DOCX formatsFamiliar interface for a smooth transition from Microsoft OfficeFree and lightweight for everyday document editing
QA img-9

Frequently Asked Questions

Can Word show a rectangle automatically whenever a page contains Heading 1?

Word does not automatically show or hide a header shape based on a paragraph style. Use Layout > Breaks > Next Page and a different first-page header for each major section instead.

How do I put the Heading 1 text in a header?

Double-click the header, then choose Insert > Quick Parts > Field. Select StyleRef and choose Heading 1 as the referenced style.

Why does changing one header affect another section?

The headers may be linked. Open the header you want to edit and turn off Header & Footer > Link to Previous. First-page and regular headers have separate links.

Why is my header showing an earlier heading?

A StyleRef field may use a preceding Heading 1 if it does not find the intended heading on the current page. Check that the section break and heading are positioned as expected.