Another way to add the file name and path (Word 2007)
In a previous post, I suggested using the method for inserting the file name and/or the file name and path that worked in versions of Word prior to Word 2007. I was under the impression that, like its predecessors, Word 2007 came with built-in Quick Parts entries (formerly called AutoText) that allowed you to insert codes for the file name and/or for the file name and path.
It’s possible that I was mistaken. I’m not 100% sure, because I’ve imported my AutoText entries from Word 2003 into Word 2007, which might explain why I have access to the codes for the file name / file name and path via Quick Parts.
If you can’t find Quick Parts entries for the file name and/or the file name and path and you can’t import them because you don’t have an earlier version of Word, not to worry. There’s another way to insert codes for the file name and/or for the file name and path — and you can use it to create your own Quick Parts entry if need be.
Position your cursor where you want the code to appear. Then click the Insert tab, Quick Parts drop-down, Field (or simply press Alt I, F). That will open the Field dialog. At the left side, you’ll see a list of fields.
Press the letter “F,” which will take you to the first field that starts with “F.” It should be FileName, but if not, press “F” again until FileName appears in the list and is highlighted.
Before clicking OK, take a look at the upper right-hand side of the Field dialog. Note that there is a checkbox labeled “Add path to field.” If you want the code to include the full path (the exact location of the file in the computer, consisting of the drive letter, folder, and any subfolders), check this box. If you want the code to include only the file name, don’t check the box. Either way, OK out of the dialog. Word will insert a code for the file name (and, if you checked the “Add path” box, the path).
If you haven’t yet saved the document on your screen, you’ll see only DocumentN, where “N” represents a number (it will vary depending on how many documents you’ve opened already in this session of Word). Once you save the doc and give it a name, the field code will change accordingly. (If for some reason it doesn’t, click within the code and press F9 or select the entire document by pressing Ctrl A and then press F9. F9 is the keystroke to update codes in Word documents.)
To turn the code into a Quick Part, do the following:
First, decide if you want to change the font size or the font face. Select the code and make any changes you like. Then, with the code selected, click the Insert tab, Quick Parts, Save Selection to Quick Part Gallery. When the dialog appears, give your entry a short name that is easy to remember, such as “path” or “filename” (without quotation marks). Case doesn’t matter; Quick Parts aren’t case sensitive.
You can type a description if you like (to remind yourself what the Quick Part does), but that’s optional. Note that Quick Parts entries are saved by default to a template called BuildingBlocks.dotx; if you prefer, you can save your entry to a different template. (You might want to save your entries to the normal.dotm template, if only because that template is less prone to corruption than the BuildingBlocks.dotx template. Either way, be sure to make backup copies of your important templates from time to time, since corruption can result in a loss of your customizations.**)
When you have finished, click OK to save the Quick Parts entry.
To insert the file name or the file name and path, simply position your cursor in the appropriate place, type the name you assigned to the Quick Part entry (path or filename or whatever you chose), and then press F3. F3 is the “expander key” that works with all Quick Part entries. (This is a carry-over from previous versions, which used F3 to expand AutoText entries.)
For people who want a code for the file name or the file name and path to appear in all documents, note that you can edit your default template (normal.dotm; each user has one) to add the code. It’s common practice to insert the code in a footer. Just be sure to open the actual template, rather than a document based on the template, if you want to make the code available globally in all new documents.
**Your user-customizable copy of the BuildingBlocks.dotx template is located here:
Windows XP — C:\Documents and Settings\\Application Data\Microsoft\Document Building Blocks\1033 (assuming you are using the American English version; if not, the number will be something other than 1033)
Windows Vista — C:\Users\\AppData\Roaming\Microsoft\Document Building Blocks\1033 (with the same caution as for Windows XP)
Entry filed under: Uncategorized.