ActiveWindow.Caption = ActiveDocument.FullName
Select allOpen in new window
© 1996-2023 Experts Exchange, LLC. All rights reserved. Covered by US Patent
There are a couple of ways that this can be approached. If you only need to know the full path name once in a while, then you can create a very simple macro and assign it to a toolbar button. When you click on the button, the information in the title bar for the active window is changed to reflect the full path name. This macro, called ChangeCaption, is as follows:
Open in new window
There are a couple of big drawbacks to this option, however. Whenever you rename the document by using Save As to save it under a different name, the new file name (and path) are not updated in the title bar unless you rerun the macro. Secondly, if you have virus checking turned on, then it may interpret your macro (assigned to AutoOpen) as an attempt by a macro virus to mess with your system.
There is a way to create a more comprehensive and automatic approach... Essentially, the steps used in accomplishing this approach are as follows:
1. Set up Word to trigger application events (they're built in to Word, but they don't happen automatically).
2. Write some the actual title-bar changing code for the DocumentChange event.
Then explains how to setup the approach, including related macro code.