VBA & Macro Problems

Fix a Word AutoOpen Macro That Does Not Run When a Document Reopens

John WilsonJohn Wilson Nov 22, 2026 868 views

Question details

The user needs a form to appear every time a Word document created from a template is opened.

Fix a Word AutoOpen Macro That Does Not Run When a Document Reopens
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.
Before you start

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.

Solution 1Recommended

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.

1
Open the template's VBA project

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.

2
Add the opening procedure

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.

3
Save and attach the template

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.

4
Test reopening the report

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.

Add AutoOpen to the attached Word template
Sharing the report: A .docx report can use code in its attached template, but each recipient must have access to that template. If the VBA code must travel inside the document, copy the required procedures and form into the document's VBA project and save it as .docm.
Free Microsoft Office alternative

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.

Open and edit activity reports in a familiar document interfaceCompatible with Microsoft Word .docx and .doc formatsFree, lightweight tools for everyday document workMove supported documents between WPS Office and Microsoft Office
microsoft office alternative - wps office

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.