Full Path Names in Word

by Allen Wyatt
(last updated August 22, 2019)


When you open a document in Word, the file name for the document is displayed in the title bar. At times, it would be nice to display more than a simple file name in the title bar. Many readers could profit by a way to display a full path name along with the file name in the title bar. Unfortunately, Word does not provide a way to do this easily. (After all, how difficult would it be to include a check box for this option?)

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:

Sub ChangeCaption()
    ActiveWindow.Caption = ActiveDocument.FullName
End Sub

Again, this macro is great for occasional use. If you desire, you can also rename this macro as AutoOpen, and then all documents, when opened, will display the full path name. 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. In order to customize Word to include the full path name, it is necessary to understand the type of interface used by Word. Word is a multiple document interface (MDI) application. This means the main application window (for Word) is the parent application window and this window can contain document windows (child windows) for each open document. When a document window is maximized, Word's title bar displays a combination of the application title (Microsoft Word) and the name of the document file. If documents are displayed in a partial screen or minimized state, then the parent window displays just the application name (Microsoft Word) and each child window shows the title of the document contained in that window. Thus, all that needs to be changed is the child window title bar to include the path with the file name.

The comprehensive approach relies on the use of Word application events. 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.

The DocumentChange event, once set-up, happens almost every time the user activates a child (document) window. You'll notice I said "almost." This is because the event doesn't get triggered if the child window is a duplicate window to an open document (for instance, the window one gets when choosing New Window from the Window menu). This is effectively two views of the same document so there is no document change when switching from one view to the other. Consequently, if a document is open and the user opens a new window to the same document, it won't automatically have it's title bar changed by the code run from the DocumentChange event. It will be changed later if and when the user changes to this 'new window' view from some other child window containing a different document, however.

The second issue is that the DocumentChange event also doesn't get triggered when a new document is saved. So, if a unsaved document (such as Document1, Document2, etc.) is saved, the title bar doesn't change until the focus is taken away from the newly saved file and then given back. Fortunately, this can be worked around.

The first step, then, is to activate the Word application events. You can do this by following these steps. (The examples here are not included on the WordTips CD-ROM. They can, however, be easily created by following the steps outlined.)

  1. Start Word, and then close all open documents.
  2. Press ALT+F11 to start the Visual Basic Editor. The title bar for the Editor should say "Microsoft Visual Basic - Normal." This means you are working on the Normal template project.
  3. Choose Class Module from the Insert menu. This adds a class module to the project, typically named Class1, Class2, etc.
  4. Using the Properties window (lower left corner of the Editor), change the name of the new class module to AppEvents.
  5. In the Editor Window, type or paste the following:
  6. Option Explicit
    ' Declare a global object variable to represent the
    ' Word Application object for accessing Application events
    Public WithEvents WordApp As Word.Application
    Private Sub WordApp_DocumentChange()
    ' The procedure that will automatically run when
    ' the DocumentChange event is triggered
        Call MyModule.WindowTitleWithPath
    End Sub

    With this foundation in place, you are ready to make sure the WordApp object is registered whenever Word is started. The way to do this is to set up an AutoExec macro which is automatically run every time Word is started. You can do this by following these steps:

  7. Choose Module from the Insert menu. This adds a regular module to the project, typically named Module1, Module2, etc.
  8. Using the Properties window (lower left corner of the Editor), change the name of the new module to MyModule. (You can use a different name, if desired. If you do change the name, then you need to also change the MyModule reference in step 5, above.)
  9. In the Editor Window, type or paste the following:
  10. Option Explicit
    ' Set up an instance of AppEvents ready to access Application's events
    Public cAppEvents As New AppEvents
    Public Sub AutoExec()
    ' Automatically runs when Word starts
        ' Initialize the WordApp object in AppEvents class
        ' setting it to equal the Word.Application object
        Set cAppEvents.WordApp = Word.Application
    End Sub
    Public Sub WindowTitleWithPath()
    ' Changes window title to include path with filename
        ' Check if any child windows open (avoid error if no active window)
        If Windows.Count > 0 Then
            ' Change the window's caption
            ActiveWindow.Caption = ActiveDocument.FullName
        End If
    End Sub

    The final part of making this customization to Word is to make sure that the title bar is updated when you save your file. You do this by replacing (with macros) the built-in FileSave and FileSaveAs commands. You can do that by adding the following code to the MyModule module:

    Public Sub FileSave()
    ' Replaces the built-in FileSave command
        ' Check if path is empty string
        If ActiveDocument.Path = "" Then
            ' If new document is not saved yet, call FileSaveAs
            Call FileSaveAs
            ' Existing document is already on disk; just save it
        End If
    End Sub
    Public Sub FileSaveAs()
    ' Replaces built-in FileSaveAs command
            ' Use the Show method for the built-in FileSaveAs dialog box
            ' Now run the code to change the window title
            Call WindowTitleWithPath
    End Sub

    When these macros are all entered, you should close Word and restart it. The title bars should all be updated to the full path names.


If you would like to know how to use the macros described on this page (or on any other page on the WordTips sites), I've prepared a special page that includes helpful information. Click here to open that special page in a new browser tab.

WordTips is your source for cost-effective Microsoft Word training. (Microsoft Word is the most popular word processing software in the world.) This tip (1248) applies to Microsoft Word 97, 2000, 2002, and 2003.

Author Bio

Allen Wyatt

With more than 50 non-fiction books and numerous magazine articles to his credit, Allen Wyatt is an internationally recognized author. He is president of Sharon Parq Associates, a computer and publishing services company. ...


Adjusting Chart Size

If you don't have Excel installed on your system, Microsoft Graph is a handy way to create simple charts for your ...

Discover More

Disabling the Caps Lock Key

A few tips and tricks for working around the dratted Caps Lock button.

Discover More

AutoFilling from a Custom List

AutoFill can be a real timesaver if you often work with set lists of data. You can define your own custom lists and then ...

Discover More

The First and Last Word on Word! Bestselling For Dummies author Dan Gookin puts his usual fun and friendly candor back to work to show you how to navigate Word 2013. Spend more time working and less time trying to figure it all out! Check out Word 2013 For Dummies today!

More WordTips (menu)

Working with E-mailed Documents

Ding! You've got mail. That mail has a Word document attached to it. Before you rush off and open that document, take a ...

Discover More

Opening Documents in Print Layout View

If you have a Word 2003 document that always seems to open in reading layout mode, you may want to turn that "feature" ...

Discover More

Size Limit for Documents

Word can handle large documents, but how large is large? This tip examines the issue and provides some advice on how ...

Discover More

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

View most recent newsletter.


If you would like to add an image to your comment (not an avatar, but an image to help in making the point of your comment), include the characters [{fig}] in your comment text. You’ll be prompted to upload your image when you submit the comment. Maximum image size is 6Mpixels. Images larger than 600px wide or 1000px tall will be reduced. Up to three images may be included in a comment. All images are subject to review. Commenting privileges may be curtailed if inappropriate images are posted.

What is 8 - 4?

2016-09-15 10:13:33

Michael Lewis

Thanks for the great instructions - this worked like a champ. The only thing I had to find was using F4 to turn on the properties window.

2016-01-27 03:39:10

Rohn MVP

JUzel take a look at this tip:

Limiting Directories in the FILENAME Field


2014-04-24 11:22:01

J Uzel

Is there a method to truncate the full path name?

The full path names of many files I work with are very long. I'm unable to change the folder names to make them shorter (that would be preferred).

Example of full path (too long):

Example of full path (truncated):

If this is possible, please let me know. I been tweaking the code you provided, but without any luck.


2013-11-21 20:06:13

Mark Bunster

Can you set it to other fields in the Word Doc? Specifically I'm trying to get it to show what's in the Title field of the Summary tab, since I have an app that calls open Word and inserts certain information. The actual title of the doc it creates is a number, which is confusing to users. If it can show the description of the doc as entered in the calling app and passed through to the Summary tab, that would be awesome. Thx

2013-08-18 06:56:21

Oriol Fortuny

Sorry, I did do something wrongly. In the first step, I chose "Module" from the Insert menu instead of "Class Module".

2013-08-18 06:15:50

Oriol Fortuny

First of all,thank you so much for your very useful tips.
I´ve followed the steps to be able to see full path names in Word 2003, but when I open I get an error message from Visual Basic, namely in the line (Modules/AppEvents):

Public WithEvents WordApp As Word.Application

After changing "WithEvents" for "AppEvents", I open a Word document and Visual Basic highlights "WordApp" and shows a small window that says "Compile error: Expected: end of statement".

I guess I must be doing something wrongly.


This Site

Got a version of Word that uses the menu interface (Word 97, Word 2000, Word 2002, or Word 2003)? This site is for you! If you use a later version of Word, visit our WordTips site focusing on the ribbon interface.

Newest Tips

FREE SERVICE: Get tips like this every week in WordTips, a free productivity newsletter. Enter your address and click "Subscribe."

(Your e-mail address is not shared with anyone, ever.)

View the most recent newsletter.