Fix Word for Mac Macro Opening a Document Only Once
Question details
A custom macro assigned to a keyboard shortcut for opening frequently used documents stops functioning after Word for Mac is restarted.

- Product
- Microsoft Word for Mac
- Device & OS
- macOS
- Scenario
- Using a keyboard shortcut assigned to a recorded macro to quickly open specific, frequently used documents without using the mouse.
- Observed behavior
- The macro successfully opens the target document the first time it is run, but completely stops working after Microsoft Word is closed and reopened.
Ensure that your target documents have not been renamed or moved from their original folders, and that the Developer tab is enabled in your Word ribbon.
Correct the Macro Declaration and Directory Path
Fix syntax errors in your VBA code, such as accidental comments and incorrect file paths, to ensure the macro executes properly every time.
When recording or writing a macro, minor syntax errors can prevent the code from running. An apostrophe before a command turns it into a comment, meaning Word will ignore it. Additionally, placeholder paths must be replaced with your actual system paths.
Navigate to the Developer tab on the Word ribbon and click on 'Visual Basic', or press Option+F11 on your keyboard.
Locate your macro code. Look at the very first line containing the 'Sub' command. If there is an apostrophe (') immediately before 'Sub', delete it. The apostrophe turns the declaration into a comment, causing the macro to fail.
Scan the code for the file path. If it says '<Your Home Directory>' or something similar, replace it with your actual macOS home directory name (for example, '/Users/yourusername/Documents/filename.docx').
Ensure the macro is saved in the 'Normal.dotm' template rather than the specific document. This guarantees the macro remains available globally even after Word is restarted.

Pin Documents to the Recents List (Alternative)
Bypass complex macro setups entirely by using Word's built-in quick access features for frequently used files.
Manage Your Documents Easier with WPS Office
If you're struggling with complex macros just to open files quickly, WPS Office offers an intuitive interface with a tabbed viewing system, robust file pinning, and seamless compatibility with Microsoft Word documents—completely free.
- 1. Install WPS Office: Download and install WPS Office for free on your Mac.
- 2. Open Your Word Documents: Open your existing .docx files directly in WPS Office with perfect formatting preservation.
- 3. Pin Your Favorites: Use the WPS homepage to instantly pin your most-used documents for one-click access in the future.

Frequently Asked Questions
Why did my macro code turn green in the Visual Basic Editor?
In the VBA Editor, green text indicates a comment. If an apostrophe (') is placed at the beginning of a line, the editor treats the entire line as a note rather than executable code. Removing the apostrophe will restore it to an active command.
How do I find my exact Home Directory path on macOS?
You can locate your exact path by opening the Terminal app and typing 'pwd', or by finding the file in Finder, right-clicking it, holding down the Option key, and selecting 'Copy as Pathname'.
Why do my recorded macros disappear when I restart Word?
This usually happens if the macro was saved to the specific document you were working on instead of the global template. To ensure a macro is available every time you open Word, save it to the 'Normal.dotm' template.
Can I open multiple documents with a single keyboard shortcut?
Yes, by writing a VBA macro that contains multiple 'Documents.Open' commands pointing to different file paths, you can open several documents at once. You can then assign this specific macro to a single custom keyboard shortcut.




