Word 2007: How to Assign a Keyboard Shortcut to Insert File Name & Path
April 24th, 2008 | by Loren |Here are the steps to assign a keyboard shortcut to an AutoText entry, which is part of the Building Blocks in Word 2007. First, you will insert the file name and path field, then save it as an AutoText Building Block, and finally assign a keyboard shortcut to use with it. These steps would work with any block of text or other field codes. In order to assign a keyboard shortcut, the item needs to be saved as a Building Block.
Insert File Name and Path
You can use this field code in a Word document to show a document’s file name and path to where it is stored. It can be used in a header, footer, or anywhere else in a document.

- Move your cursor to where the filename should appear.
- In the Insert tab, Text group, click the Quick Parts button, then choose Field.
- In the Field box, change the Categories: to Document Information.
- In the Field Names: list, choose FileName.
- If you want the path included, under Field Options, check the Add path to filename box.
Note: In the Field Properties section, you can specify the format, ie. uppercase, lowercase, for how the path/filename displays.
Steps to Save the Filename Code as a Building Block

Building Blocks are all the ready-to-use Galleries in Word, which includes Quick Parts, Cover Pages, Header and Footers, and Text Boxes.
- Select the code you inserted in the above steps. (It will turn gray if you click on it, that’s just indicating that it’s a code. You need to actually select it by dragging the mouse across the entire path, or Ctrl + Click on it.)
- On the Insert tab, Text group, click Quick Parts, then click Save Selection to Quick Part Gallery.
- In the Create New Building Block box that appears, type in a Name:, like filepath, and change the Gallery: to AutoText. (Remember the name, as you will need it when you assign the keyboard shortcut to it.) Click OK to save.
Assign a Keyboard Shortcut
- Click the Office button, then Word Options. In the Customize category, look for Keyboard Shortcuts, click the Customize button.
- In the Customize Keyboard box, change the Categories to AutoText.
- In the AutoText box, scroll through to the name you assigned to the filename and path field and click to select it.
- Press the shortcut keys you want to assign to it: Word will show you what those keys are currently assigned to, if you want to re-assign them, click Assign. The key combination should show up in the Current keys: box.
- Click Close to finish.
Remember to test your new keyboard shortcut to be sure it’s working.

Another Way to Insert the Quick Part
You can insert a Quick Part using the name (filepath); type the name for the Quick Part into your document, then immediately push F3.
Updating Fields
- If the filename and path does not update automatically, right-click on it and click Update Field or select it and push F9.
- To always have fields update when you use print or print preview, click the Office button, then Word Options. In the Display category, Printing Options section, check Update Fields before Printing.
Popularity: 7% [?]
15 Responses to “Word 2007: How to Assign a Keyboard Shortcut to Insert File Name & Path”
By Donna Gerringer on Nov 19, 2009 | Reply
Because of these shortcuts, I am beginning to change my opinion of Word 2007. Not only do I like the shortcut to the footer, I appreciate the links to other information at the end of the article, for then I moved on to ‘Create and use document building blocks in Word 2007′ where I (now) quickly and easily created a Quick Part. I now LOVE this feature!
Thanks for a user-friendly site!
By Joel Marin -- Seattle Yet, Hopeful on Aug 16, 2009 | Reply
You’re the BEST!
THANK YOU, THANK YOU, THANK YOU!
I decided I should show the filename on each page of a report consisting 75 different files…
Alright, I’ll just assign a shortcut key to the filename function,turn-up the music, and zone out for a bit;
No, of the -HUNDREDS- of Customizable commands in Keyboard Shortcuts, insertfilename is not one of them.
Fine, what else is new; Microsoft Help Online is sure to have the simple steps needed to get me on my way – right?
So, a Cruise ship passes a small desert island… everyone watches as a ratty looking bearded man runs out on the beach and starts shouting and waving his hands; “Who’s THAT?” asks one of the passengers…
“I have no idea,” replies the Captain,
“But every year we sail past and he goes nuts.”
It sucks when the way out is right there –
so close, so simple…
By Connie on Mar 30, 2009 | Reply
I have filepath set up and know how to update when saving a document under a new name. What I want to know is if there is a way to make it automatic like it does in WP?
By Simon Quail on Mar 23, 2009 | Reply
Now found a spare mo after 6 months to waste trying the offical Word 2007 steps as described. Its AWFUL!! I agree with Mr Charming. It WAS easier in Word 2003. How can we get MS to bring that autotext back?
By Loren on Jan 9, 2009 | Reply
Hi Tracey – you’re saying that the filename that prints in the document is not the same name as document you have open? I haven’t seen that happen before, except when the filename field hasn’t updated. The first thing I would try is updating the filename field (select it, push F9) and see if it displays the correct filename. If not, I would try renaming the file (close it, right-click on file icon, choose Rename) then updating the field again to verify it’s working.
Hope that helps, good luck!
By Tracey Graham on Jan 9, 2009 | Reply
How do I get the correct path name to print in my document? When going through the steps in Quickpart, the file name of the document prints correctly, but the file name is incorrect.
By Lorie Whitney on Dec 4, 2008 | Reply
Great site and information. Inserting the file name and path information is wonderful, thank you.
By Judy Hurst on Nov 26, 2008 | Reply
How do you assign a keyboard shortcut key to insert a file name and path? Or, how can I insert the file name and path that is NOT in the header or footer
By Loren on Oct 31, 2008 | Reply
Hi Ming, as far as I know, in most e-mail programs you would have to use the the Insert, Link or Hyperlink menu options in order to insert an active link. There would be choices for web pages, local files, etc. If you want to link to a local file, you could paste the file name and path from a Word doc.
If you used to be able to create the link just by pasting; were you using a different e-mail program, or a different a version or settings?
Hope that helps you. Good luck and thanks for asking!
By Ming on Oct 31, 2008 | Reply
How come the file name and path are not hyperlinks to the document, when I copy and insert into emails?
This was a very nice option for people to now send huge files to email lists, but send hyperlink paths…
By Loren on Oct 27, 2008 | Reply
Mr. Charming, what you could do is create a document template that already includes the filename and path, plus has all other required formatting done. You would start all new documents from that template.
The directions in this article are for a one-time setup that would create a short-cut key to insert the filename and path. They are not the steps to just insert the filename and path, they are the steps you would take to assign a keyboard shortcut.
By Mr. Charming on Oct 27, 2008 | Reply
Are you friggin kiddin me? There is no way to set Word 2007 to automatically insert the filepath in ALL documents? Our organization requires filepaths on all documents created here, and we have to go through this hideous list of steps every time we create a new document? Tell me I’m missing something easier….
By Simon Quail on Sep 15, 2008 | Reply
in Word 2003 I could select “Filename and path” from the customise toolbar comands and drop it into my formating tool bar and click on it to use it for ANY doc. and it would drop in the filename and path. I cannot figure out how to do this in Word 2007! very sad. Is it possible. Quick Parts is far too clunky for this job.
By Loren on Jul 25, 2008 | Reply
Glad to be of help, Kate, and thanks for the kind words. Your feedback shows me that I’m doing what I set out to: provide short, clear, how-to articles.
Thanks again!
By Kate Day on Jul 25, 2008 | Reply
I’ve found this such a useful website – short chunks of learning, with great diagrams and unambiguous descriptions/instructions. Glad I found you!
Kind Regards
Kate