![insert file name in word document insert file name in word document](http://img.techwallacdn.com/640/ppds/9afa84d6-e0fa-4183-9dd6-487d64e2ffbe.png)
Because Word will display the document’s name automatically, there’s little use for it. For better or worse, this simple macro most likely will not display the full path I have never seen it work consistently.
![insert file name in word document insert file name in word document](https://d2drx6n2xb0i5r.cloudfront.net/site/wp-content/uploads/2018/08/oo_wordcount-1024x523.jpg)
The code is Listing B usurps this event and allows Word to display the document’s FullName property in the title bar. Saving the file triggers an internal event, FileSaveAs. If Dialogs(wdDialogFileSaveAs).Show = 0 Then Exit SubĪctiveWindow.Caption = ActiveDocument.FullName Using the directions from above to open the VBE, add the code in Listing B and Listing C to a document when you want to display the full pathname in the title bar… except, the solution doesn’t always work. If you need a bit more, consider using VBA to display the full path and filename in the title bar. SEE: Microsoft Office 365: The smart person’s guide Use VBA for title bar displayĭisplaying the filename in the document will be adequate for most of us. We’re not going to cover an extensive list of expressions, but it’s important to know that expressions give you more flexibility and control over where the document displays the field.
#Insert file name in word document update#
When you want to display the document’s name and path in the file itself, you can type it, but if you change the filename, you must remember to update the name in your document.
#Insert file name in word document how to#
How to insert absolute and relative hyperlinks in a Microsoft Word document How to return first and last times from timestamps in Microsoft Excel Master Microsoft Office with this accredited training The solutions discussed in this article aren’t compatible with 365. You can use any file you want or you can download the demonstration. I’m using Word 2016 on a Windows 10 64-bit system, but you can apply these solutions all the way back to Word 2003. In this article, I’ll show you solutions to these requirements and warn you when they don’t work as expected. That’s because what seems simple has some unexpected kinks. Unfortunately, both requirements often leave users scratching their heads in frustration. That’s adequate for most of us, but occasionally, you’ll want the document’s name to print with the content or you’ll want the entire path in the title bar. If it’s a new blank document, Word displays a generic name, document x, until you name the file. When you open a Word document, Word displays its name in the title bar. You can display the name of a Word document in the header or footer-or even in the title bar- but the results are a little rough around the edges. How to display the filename and path in a Word document or title bar