Inserting a Document's File Location

Written by Allen Wyatt (last updated February 22, 2020)
This tip applies to Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365


It is often handy to insert the location of a document into your document itself. For instance, you may want the footer of your document to include an indication of a document's file name, along with the full path for the file. You can do this easily by following these steps:

  1. Position the insertion point where you want the file name inserted.
  2. Choose the Insert tab of the ribbon.
  3. Click the Quick Parts tool in the Text group.
  4. Choose Field. Word displays the Field dialog box. (See Figure 1.)
  5. Figure 1. The Field dialog box.

  6. Choose Document Information from the Categories list.
  7. Select FileName from the Field Names list.
  8. Make sure the Add Path to Filename check box is selected in the third column of the Field dialog box. (See Figure 2.)
  9. Figure 2. The Add Path to Filename check box selected.

  10. Click on the Field Codes button. Word modifies the display of the dialog box.
  11. Click Options. Word displays the Field Options dialog box.
  12. Click on the Field Specific Switches tab. (See Figure 3.)
  13. Figure 3. The Field Specific Switches tab of the Field Options dialog box.

  14. Choose the \p option. (This causes the path of the file name to be included in the field results.)
  15. Click on Add to Field.
  16. Click on OK to close the Field Options dialog box.
  17. Click on OK to close the Field dialog box and insert the field.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (7552) applies to Microsoft Word 2007, 2010, 2013, 2016, 2019, and Word in Microsoft 365.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...


Creating See-through Text Boxes

When laying out your document, you may want to use a text box that appears to be positioned over your text, but to be ...

Discover More

Word Count in Multiple Selections

Getting a word count for an entire document is easy. What you may not know is that some versions of Word can also provide ...

Discover More

Drop-Down List Font Sizes

Excel has several features that cannot be customized. The font size in the drop-down lists is one of them. If you need ...

Discover More

Comprehensive VBA Guide Visual Basic for Applications (VBA) is the language used for writing macros in all Office programs. This complete guide shows both professionals and novices how to master VBA in order to customize the entire Office suite for their needs. Check out Mastering VBA for Office 2010 today!

More WordTips (ribbon)

Counting Fields in a Document

Need to count the number of times a particular field appears in a document? It's easy to do when you apply the techniques ...

Discover More

Understanding DATE Field Formatting

One of the most commonly used fields is the DATE field. You can specify how the DATE field displays the current date by ...

Discover More

Quickly Inserting the Date Your Way

Tired of messing with inserting the date and then changing it to a format that is more to your liking? There's a quick ...

Discover More

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.


If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] (all 7 characters, in the sequence shown) in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is seven more than 9?

2022-03-08 08:52:31


Shelley, see the link at the right side of the page to the WordTips channel on YouTube.


2022-03-07 23:59:50


Thank you so much. This was very helpful. I plan to teach my Mum how to use word.doc. Do you have any videos?

2022-03-07 10:18:11


Tomek, the general purpose answer lies in a updating fields by via a macro such as done in this post: Also see


2022-03-04 17:18:22


BTW: the trick i posted a few minutes ago works better than updating fields by pressing F9, as the latter will only update selected fields and you need to repeat it for all footers and headers separately.
It also updates fields inside text boxes and tables all at once.

2022-03-04 17:07:19


Pretending to print by going to print preview no longer updates the fields, at least in my Word from MS365 Family, but I remember it also stopped working in my Word 365 in the office (I am now retired). It still works if you actually print it, even if it is to a nul printer, which I set up specifically for this purpose (named "NulPrint"). I also created a macro to print to the null printer then restore the printer originally selected. I added it to my QAT.

Sub NulPrint()

CurPrinter = ActivePrinter
ActivePrinter = "NulPrint"
ActivePrinter = CurPrinter

End Sub

2022-02-28 09:55:30


The answer to all three comments below is that the file field will "sort of" automatically update. The field needs to be updated either by pressing F9, printing the document, or "pretending to print" the document (e.g., going into print preview).


2022-02-25 10:28:47


How do you set the file location to an anonymous/private number string instead of etc?

2021-10-21 13:38:02


This is a great tip. I was hoping to have a way to insert a DYNAMIC file path that would update if a document was copied or moved to another folder. Do you know if that's possible?

For example, if I had a file on my hard drive with path c:\documents\example.docx and I moved/copied it to a shared network drive a:\shared-docs\example.docx, the file path in the document would update.

2020-02-26 09:08:55


If the document is moved ... does the file path update?

This Site

Got a version of Word that uses the ribbon interface (Word 2007 or later)? This site is for you! If you use an earlier version of Word, visit our WordTips site focusing on the menu interface.


FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.