Code for filename / filename and path (Word, recent versions — except Word 2007)
NOTE (added on 9/5/2009): See also the July 21, 2009 post entitled “Another Way to Add the File Name and Path,” located here. That post explains how to add the file name and path in Word 2007.
Most recent versions of Word come with built-in “AutoText” entries that allow you to insert a code for (1) a document’s name or (2) the full “path” of the document in the computer (the drive, folder, subfolder, etc. where the file is located), plus file name.**
To add the code for the file name only, position the cursor where you want the code to go, then type “filename” (without quotation marks) and press F3, the trigger key. IMPORTANT: Make sure that there is no space between “file” and “name,” or the trigger won’t work. On the other hand, AutoText entries aren’t case sensitive, so it doesn’t matter whether you type in lower case, upper case, or some combination of the two.
To add the code for the entire path, including the file name, type “filename and path” (without quotation marks) and press F3. Be careful to type “filename” as a single word — as mentioned in the preceding paragraph, you need to make sure there isn’t any space between “file” and “name” — but do hit the spacebar between the words.
Once you’ve inserted the code in your document, you can select it and change the font and/or font attributes such as font size (i.e., you can make it smaller). Even cooler, you can turn it into your own customized AutoText entry so that you can insert the code without doing a lot of typing. To do so, select the code and press Alt F3. When the Create AutoText (Word 2003 and older) dialog appears, give the entry a short name or abbreviation, like “tag” (without quotation marks), and click OK. Now, when you’re ready to insert the code, type “tag” (or whatever you chose as the name) and press F3 to expand the entry.
Keep in mind that if you insert a file name or file name and path code as a footer in a template, you won’t have to add it to any specific document; it will be embedded in every document based on that template.
**The exception to this rule is Word 2007. For some reason, Microsoft didn’t include Quick Parts entries for the file name and path in that version. (Word 2007 uses the terms “Quick Parts” and “Building Blocks” instead of “AutoText.”) However, if you have an earlier version of Word, you can import your AutoText entries into Word 2007. I’ll explain how in a later post.
Entry filed under: Uncategorized.