How to Fix a Word AutoExec Macro That Does Not Open a Document
Question details
The user needs a Word macro to automatically open a specific document when the application starts, but the current macro is failing to execute properly.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- Setting up Word to automatically open a frequently used document on startup using an AutoExec macro.
- Observed behavior
- The macro does not open the document upon starting Word, possibly due to incorrect naming, wrong template location, or macro security settings blocking execution.
Ensure you have the exact file path to the document you want to open and verify that your Word macro security settings in the Trust Center allow scripts to run.
Manually Configure the AutoExec Macro in the Normal Template
Use the Visual Basic Editor to correctly name and place the AutoExec subroutine in the Normal template, ensuring Word triggers it perfectly upon launch.
The macro recorder is not always reliable for setting up startup scripts. Manually adding the AutoExec procedure to a standard module inside your Normal template is the most robust method to ensure a document opens automatically.
Launch Microsoft Word and press Alt + F11 on your keyboard to open the Visual Basic Editor.
In the left Project pane, locate 'Normal'. Right-click on it, select 'Insert', and then click 'Module'. You can also use an existing module like Module1.
In the main code window, type the AutoExec subroutine and use the complete file path. For example: `Sub AutoExec() On Error Resume Next Documents.Open "C:\Users\YourName\Documents\Scratchpad.docx" End Sub`.
Save the changes to your Normal template in the editor, close the Visual Basic Editor, and restart Word to test if the document automatically opens.

Try WPS Office for Seamless Document Management
If you want to avoid complex macro configurations in Microsoft Word, consider switching to WPS Office. It provides a lightweight, intuitive interface, built-in tabbed document management, and excellent compatibility with Microsoft Office file formats.
- 1. Download and Install: Visit the official WPS website to download and install the free WPS Office suite.
- 2. Open Your Documents: Launch WPS Writer and easily open or pin your frequently used documents using the intuitive tabbed workspace.

Frequently Asked Questions
Why does my recorded Word macro fail to open documents on startup?
The macro recorder can sometimes be unreliable for capturing application-level events like startup actions. It is highly recommended to manually write or verify the VBA code in the Visual Basic Editor using the standard 'AutoExec' naming convention.
Where must an AutoExec macro be saved to work properly?
An AutoExec macro must be stored in a standard module within the Normal template (Normal.dotm). This ensures that the macro loads automatically into the application's memory every time Word is launched.
Can macro security settings prevent my AutoExec script from running?
Yes, if your Word Trust Center settings restrict macros, the AutoExec macro will be blocked from executing. You must either set your macro security to enable all macros or place the target document and template in a Trusted Location.




