Office for Mac Issues

Why ThisDocument.Path Differs From ActiveDocument.Path in Word for Mac

Elise WilliamsElise Williams Nov 25, 2026 868 views

Question details

Understand why two Word VBA properties return different paths and how to get the active document's location.

Why ThisDocument.Path Differs From ActiveDocument.Path in Word for Mac
Product
Microsoft Word for Mac
Device & OS
macOS
Scenario
A user runs VBA code stored in a document or template and wants the path of the document currently open.
Observed behavior
ThisDocument.Path can return the macro container's location, while ActiveDocument.Path returns the active document's location.
Before you start

Open the document whose location you want and save it if it has not been saved yet. Check whether the VBA code is stored in that document, Normal.dotm, or another template.

Solution 1Recommended

Use ActiveDocument.Path for the open document

Use this property when the macro needs the folder containing the document currently active in Word.

ThisDocument refers to the document or template containing the code, so its path can differ from the active document's path.

1
Open the VBA editor

In Word for Mac, open the document and select Tools > Macro > Visual Basic Editor.

2
Change the path reference

In the macro, replace ThisDocument.Path with ActiveDocument.Path where you need the active document's folder. For example, use Debug.Print ActiveDocument.Path.

3
Run and check the macro

Make the intended document active, run the macro from Tools > Macro > Macros, and check the output in the VBA editor's View > Immediate Window.

Use ActiveDocument.Path for the open document
Save new documents first: An unsaved document has no saved folder path. Use File > Save before relying on ActiveDocument.Path.
Free Microsoft Office alternative

Edit Word documents with WPS Office

WPS Office is a free, lightweight alternative with a familiar interface for opening and editing Word documents. Its format compatibility makes it easier to move everyday documents from Microsoft Office, although it does not fix Word for Mac VBA behavior.

Open and edit Microsoft Word DOCX documentsWork with documents in a familiar word-processing interfaceMove everyday documents from Microsoft Office without changing your workflowUse a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Why does ThisDocument.Path return a template folder?

ThisDocument refers to the document or template containing the VBA code. If the code is in Normal.dotm or another template, its path identifies that container rather than the active document.

How do I get the folder of the document I am editing?

Use ActiveDocument.Path in your Word VBA code. Make sure the intended document is active and has been saved.

Why is ActiveDocument.Path empty?

A new document that has not been saved has no saved folder path. Select File > Save, choose a location, and run the macro again.

How can I see both VBA path values?

Add Debug.Print ThisDocument.Path and Debug.Print ActiveDocument.Path to the macro. Run it and select View > Immediate Window in the VBA editor to inspect the output.