How to Print the Full File Path in a Word Document
Question details
The user wants to automatically display and print the exact directory path or file location of a Word document within the document itself.
- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Preparing a document for printing and needing to retain a physical reference to its digital file location on a local drive or network.
- Observed behavior
- The user needs to configure the document to dynamically show the full file path using field codes.
Ensure your document is saved to your computer or network drive first, as unsaved documents will not have a valid file path to display.
Use Field Codes to Insert and Print the File Path
You can use the built-in FILENAME field code with a specific formatting switch to display the entire file path dynamically in your Word document.
Microsoft Word allows you to insert dynamic field codes that update automatically based on document properties. By using the FILENAME code with the \p switch, Word will fetch and generate the exact file location.
Click in your document where you want the file path to appear. This is commonly placed in the header or footer so it prints on every page.
Press 'Ctrl + F9' on your keyboard to insert a pair of field code braces: { }. Note: On some laptops, you may need to press 'Ctrl + Fn + F9'.
Inside the newly created braces, type the following text exactly: FILENAME \p
Press 'F9' (or 'Fn + F9') to update the field. The code will disappear and be replaced by the full file path of your document.
Proceed to print your document as usual (File > Print). The file path will be included exactly as it appears on your screen.
Insert and Print File Paths Easily with WPS Writer
WPS Office Writer offers robust support for field codes, allowing you to seamlessly insert, display, and print file paths just like in Microsoft Word. It provides a visual menu for inserting these codes, so you don't even need to memorize keyboard shortcuts.
- 1. Open your document: Launch WPS Writer and open the document you wish to print.
- 2. Navigate to the Insert tab: Click on the 'Insert' tab in the top ribbon menu and select 'Field'.
- 3. Select the FileName field: In the Field dialog box, choose 'Document Information' under Categories, select 'FileName' under Field names, and check the 'Add path to filename' option.
- 4. Insert and Print: Click 'OK' to instantly insert the full file path into your document, then proceed to print.

Frequently Asked Questions
Why does the file path not update when I move or rename the file?
Field codes do not always update automatically in real-time. If you move or rename the file, you need to refresh the field. Click on the file path text and press F9, or right-click it and select 'Update Field'.
Can I put the file path in the footer so it prints on every page?
Yes. Double-click the bottom margin of your document to open the Footer area, and then insert the { FILENAME \p } field code there. It will automatically replicate across all pages of your document.
Why am I seeing the code text instead of the actual file path?
You likely have field codes toggled on. Press 'Alt + F9' (or 'Alt + Fn + F9' on a laptop) to toggle between displaying the raw field codes and displaying their actual results.
Does this work if the document is saved on a cloud drive like OneDrive?
If the document is synced to a cloud service, the file path may display the cloud URL (e.g., https://d.docs.live.net/...) instead of the local C: drive path, depending on your synchronization settings.




