Skip to content
DocumentTaskLab

Word tasks · Headers and footers

Put a document's file name and path in its footer

Written November 24, 2026

A printed draft that names its own file — and the folder it lives in — can always be traced back to the master copy. This guide puts the file name, and optionally the full path, into a Word footer as a FileName field, so the footer follows the file when it is renamed or moved instead of going stale the way typed text does.

Insert the file name in the footer

Microsoft's documentation for the field codes: FileName field describes what the field inserts: the name of the current file, taken from the saved document. Because it is a field, the footer can follow the file when the file is renamed or moved — typed text cannot.

  1. Save the document first. The FileName field reads the name the file is saved under. An unsaved document has no real name or folder yet, so save with File > Save As and give the file its final name before you build the footer.
  2. Open the footer. Double-click in the footer area at the bottom of any page. The Header & Footer tab appears. Click where the file name should sit, or press Tab to move to the center or right tab stop.
  3. Insert the FileName field. On the Insert tab, choose Quick Parts > Field. In the Field dialog, select FileName from the field names list. Leave the format as it is for now and select OK. The saved file name appears in the footer.
  4. Add the full path if you need it. Repeat Quick Parts > Field, select FileName again, and this time turn on the field option to add the path to the file name — the \p switch. The footer now shows the folder as well as the name, for example a shared-drive folder followed by the file name.
  5. Close and check a second page. Choose Close Header and Footer and scroll to another page. The same footer repeats there, because a footer belongs to the section, not to one page.
Name only, or name and path?

Use the plain file name on documents you send out: it identifies the file without exposing your folder structure. Use the path version on internal drafts and controlled documents, where the point is to find the master copy again — a printed page that names its own folder can be traced back to the source in seconds.

Update the field after a rename or move

A field does not watch the file system. When the document is renamed with Save As, or moved to another folder, the footer keeps showing the old result until the field is updated — updating is one keystroke, and it is the step people forget.

  1. Update in place. Open the footer, click the file name so the field is selected, and press F9. The field re-reads the current name and path and shows the new result.
  2. Update the whole document at once. Click in the body, press Ctrl+A to select everything, then press F9. Word updates the fields in the body; open the footer and press F9 there as well if the footer result still looks stale.
  3. See the code behind the result. Click the field and press Alt+F9. The footer shows { FILENAME }, or { FILENAME \p } when the path switch is on. Press Alt+F9 again to return to the result. The \p switch is the whole difference between the name-only and the name-and-path versions, and you can add or remove it here if you are comfortable editing field codes.
  4. Set fields to update before printing. If these footers exist so printed copies can be traced, open File > Options > Display and, under Printing options, turn on the option to update fields before printing. Printed copies then carry the current name even if nobody pressed F9.

End state

When it goes wrong

Related document tasks

Sources