When you open a new document, Word displays a generic name in the title bar — documentx. Once you give the document a meaningful name (by saving it), Word updates the name in the title bar. However, in both cases, Word displays only the filename. It won’t display the full path to the document.
Fortunately, most of us don’t care what’s in the title bar, but for if you do, VBA is your answer. A simple macro will update the contents of the title bar to display the document’s name and path. To add this macro to a document (you can also add it to the Normal.dot template so that every new document you create includes the macro), do the following:
- With the file open, press [Alt]+[F11] to open the Visual Basic Editor (VBE).
- Add the following auto macro to the This Document module:
Sub AutoOpen()
'Display document name and path in the title bar.
ActiveWindow.Caption = ActiveDocument.FullName
End Sub
- Return to the Word document, then save and close it.
-
Open the document. This will trigger the auto macro, which displays the document’s full pathname in the title bar.
The security setting could delay the display, but only temporarily. With all but the lowest setting, Word prompts you to enable macros when you open the document. As soon as you do so, Word will run the auto macro and update the title bar.
Since this is an auto macro that runs only when you open the document, Word won’t update the contents in the title bar when you save the file. If that’s a problem, add a second macro to respond to your save tasks. Open the document’s module and add the following macro to ThisDocument:
Sub FileSaveAs()
'Display document name and path in the title bar.
If Dialogs(wdDialogFileSaveAs).Show = 0 Then Exit Sub
System.Cursor = wdCursorNormal
ActiveWindow.Caption = ActiveDocument.FullName
End Sub
You’ll need both macros for a complete fix: The first macro updates the title bar when you open the document and the second updates when you rename the document.