Link Microsoft Word Header or Footer Text to Document Content
Question details
Display a reference number or date from the document body in a Microsoft Word header or footer.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- The user wants header or footer text to reflect information entered in the document body.
- Observed behavior
- A StyleRef field displays text associated with a selected document style in the header or footer.
Identify the text you want to display and choose a style that distinguishes it from other document content. If you need both a reference number and a date, use a separate style for each.
Insert a StyleRef Field in the Word Header or Footer
Use this method to display styled text from the document body in a header or footer.
A StyleRef field retrieves text based on its style rather than linking to a specific location. If the same style is used for several entries, the displayed text depends on where Word finds a matching entry.
Select the reference number or date in the document body. On the Home tab, choose a suitable style from Styles, or create a distinctive style for that text.
Double-click the header or footer area, or use Insert > Header or Insert > Footer and choose an option to edit.
Place the cursor where the text should appear. In Word for desktop, select Insert > Quick Parts > Field, choose StyleRef, select the source text's style, and click OK.
To display a date as well as a reference number, insert a second StyleRef field and select the separate style applied to the date.
After changing the source text, right-click the field in the header or footer and select Update Field. Check the displayed value, especially if the source style is used elsewhere.

Edit Word Documents with WPS Office
WPS Office is a free, lightweight alternative for editing documents in a familiar interface. Its Microsoft Office format compatibility helps you move existing files into WPS; verify StyleRef fields in Microsoft Word when their behavior is essential.

Frequently Asked Questions
Why does the StyleRef field show the wrong text?
The selected style may be applied to more than one entry. Apply a distinctive style to the intended source text using Home > Styles, then select that style in the StyleRef field.
How do I refresh the header after changing the reference number?
Open the header or footer, right-click the StyleRef field, and select Update Field. Check that the source text still has the style referenced by the field.
Can I show both a date and a reference number?
Yes. Apply a different style to each item in the document body, then insert a separate StyleRef field for each style through Insert > Quick Parts > Field.
Can I change the document body by editing the header field?
No. A StyleRef field displays styled source text. Edit the reference number or date in the document body and update the field if needed.




