Document Editing Problems

How to Automatically Display the Saved Word File Name in a Header

Adam DavisAdam Davis Nov 3, 2026 869 views

Question details

The user wants the header of a locked Word template to automatically update and display the new file name when the document is saved under a different name.

How to Automatically Display the Saved Word File Name in a Header
Product
Word
Device & OS
not provided
Scenario
Saving a locked template with a new name and needing the header to reflect the updated file name or client name without manual edits.
Observed behavior
The header retains the original text and does not automatically copy the saved file name into the header text without using a specific field or macro.
Before you start

Ensure you have the necessary permissions or password to temporarily unlock the Word template, as you must insert dynamic fields into the header before restricting editing for end users.

Solution 1Recommended

Insert a FileName Field into the Header

Use Word's built-in FileName field to dynamically pull the current saved file name into the document's header.

The FileName field automatically detects the name under which the document is saved. This is the most direct way to display the file name, though it will typically include the file extension (like .docx).

1
Unlock the template

Temporarily remove the editing restrictions on your template so you can modify the header.

2
Open the header area

Double-click the top margin of your document to access the Header section.

3
Navigate to Field settings

Go to the Insert tab on the ribbon, click on Quick Parts, and then select Field from the dropdown menu.

4
Insert the FileName field

In the Field dialog box, scroll through the Field names list and select 'FileName', then click OK.

5
Save and update

Save the template under a new name. To see the updated name, you may need to force a refresh by switching to Print Preview or selecting the field and pressing F9.

Insert a FileName Field into the Header
Field Updates: Fields in Word do not always update instantly upon saving. You can enable automatic field updates before printing in Word's Options menu.
Powerful Document Editing

Easily Manage Headers and Dynamic Fields with WPS Office

WPS Writer offers an intuitive and highly compatible interface for inserting dynamic fields, document properties, and managing headers in your professional templates.

  1. 1. Open your template in WPS Writer: Launch WPS Office and open the document or template you wish to edit.
  2. 2. Access the Header: Double-click the header area at the top of the page to enter editing mode.
  3. 3. Insert the dynamic field: Navigate to the Insert tab, click on 'Fields', select 'Document Information', and choose 'File Name'.
  4. 4. Save and refresh: Save the document with a new name. Select the inserted field and press F9 to update it instantly.
Fully compatible with Microsoft Word formats (.docx, .dotx, .doc)Easily insert dynamic fields like File Name or Date into document headersLightweight software with a familiar, user-friendly interfaceSeamless migration with advanced document protection features
microsoft office alternative - wps office

Frequently Asked Questions

Why doesn't the FileName field update immediately after saving?

Word requires fields to be refreshed to display new data. You can manually update the field by selecting it and pressing F9, or you can force an update by switching to Print Preview.

Can I hide the .docx extension when using the FileName field?

The standard FileName field displays the full saved name, including the extension. If you want to display just a clean client name, it is recommended to use Document Properties (like Title) instead of the FileName field.

How do end users update the header if the template is locked?

If you map a Document Property (such as Subject or Title) in the header, users can update the text by going to File > Info and editing the property details. This changes the header text without requiring a password to unlock the document.