Fix a Word AutoOpen Macro That Does Not Run When a Document Reopens
Question details
The user needs a form to appear every time a Word document created from a template is opened.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- An activity-report template displays a form when a technician creates a document; the form should also appear when the saved report is reopened.
- Observed behavior
- AutoNew displays the form for a new document, but the form does not reappear after the document is saved and reopened as a .docx or .docm file.
Locate the template containing the working AutoNew procedure and confirm that the form should appear whenever the report opens. Check that the template is saved as a macro-enabled .dotm file and is accessible to users who open the report.
Add AutoOpen to the attached Word template
Use this approach when the form and AutoNew procedure are stored in a template that remains attached to the document.
AutoNew runs when a document is created; AutoOpen runs when an existing document is opened. Saving a document as .docm does not by itself add an AutoOpen procedure.
In Word, open the template, then select Developer > Visual Basic. In the Project pane, find the template's VBA project and the standard module containing AutoNew.
In the standard module, add the following procedure if it does not already exist: Public Sub AutoOpen() AutoNew End Sub. Ensure AutoNew is a public procedure accessible from that module.
Save the template as a .dotm file. Open the report and use Developer > Document Template > Attach to select that template; confirm the template is available at the attached location.
Save and close the report, then reopen it in Word. If a security warning appears, enable macros only if you trust the template and its source, and check that the form appears.

Check Word's macro security settings
Use this check if AutoOpen is present and the template is attached, but the form still does not appear.
Edit Word reports with WPS Office
WPS Office is a free, lightweight Office alternative with a familiar interface for opening and editing Word reports. Its format compatibility can help you move documents between office suites, although it does not fix Word's AutoOpen settings or guarantee compatibility with VBA forms and macros.

Frequently Asked Questions
Why does AutoNew run but AutoOpen does not?
AutoNew is intended for document creation; reopening an existing document requires an available AutoOpen procedure. Add AutoOpen to a standard module in the attached template and have it call the form or AutoNew.
Can a .docx file use a macro from its attached template?
Yes. The code can remain in the attached macro-enabled template while the report is saved as .docx. Use Developer > Document Template to check the attachment, and ensure the template is accessible to each user.
When should I save the report as .docm?
Save it as .docm when the VBA code and form must be stored inside the document. Use the VBA editor to copy the required components into the document's project; changing the file extension alone does not copy them.
What should I check if the form still does not appear?
Check Developer > Document Template for the correct template, then review File > Options > Trust Center > Trust Center Settings > Macro Settings. Reopen the report and inspect any security or template-availability warnings.




