Categories
VBA

Display the full pathname of a Word document in the Title Bar

I have to have multiple Microsoft Word documents open when I am marking CAT practical assessment papers. As I have the Learner’s file, the original file, as well as the solution file open and they all, have the same name, it becomes difficult to know which one I am viewing.

As constantly clicking on File to view the full path in the File properties is time-consuming and irritating, I went in search of a method to display the full path in the Title Bar.

  1. Open a (new) document in Microsoft Word
  2. Pres: ALT+F11 to open the Microsoft Visual Basic for Applications window
  3. Right-click: Project – Normal and select Insert Module
  4. Paste the following code into the window:
Sub AutoOpen()
    ' Display document name and path in the title bar
    ActiveWindow.Caption = ActiveDocument.FullName
End Sub

By foxbeefly

PHP / MySQL Developer

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.