VBA & Macro Problems

Why a Word AutoNew Macro Does Not Run When WPS Writer Starts

John WilsonJohn Wilson Nov 13, 2026 869 views

Question details

Users need to know why an AutoNew macro does not run when Word or WPS Writer starts with a blank document, and how to use AutoExec instead for startup automation.

Why a Word AutoNew Macro Does Not Run When WPS Writer Starts
Product
WPS Office Writer
Device & OS
not provided
Scenario
The user created an AutoNew macro expecting it to run every time a new blank document is opened at application startup.
Observed behavior
The AutoNew macro runs only when a new document is created from a template and does not run when WPS Writer starts with a blank document.
Before you start

Open the macro editor in WPS Writer with Alt+F11 and confirm that the macro is stored in the correct project, such as Normal or the active template. Also make sure macros are enabled so startup procedures can execute.

Solution 1Recommended

Use AutoExec for Startup Actions and AutoNew for Template Documents

Use this approach when you need view, zoom, or other settings to apply both when WPS Writer starts and when a new document is created from a template.

AutoExec runs once when the application launches, so it is the correct automatic macro for startup settings. AutoNew runs only when a new document is created from a template, which explains why it may not run at startup with a blank document.

1
Open the VBA editor

In WPS Writer, press Alt+F11 to open the Microsoft Visual Basic for Applications editor.

2
Insert a module

In the Project Explorer, select your template or Normal project, then click Insert > Module.

3
Create the AutoExec macro

Enter Sub AutoExec() and call the procedure that applies your startup settings, such as SetViewAndZoom.

4
Create the AutoNew macro

Enter Sub AutoNew() and call the same procedure so documents created from the template receive the same settings.

5
Save and test

Save the file as a macro-enabled template or document, close it, and reopen WPS Writer to confirm the startup macro runs.

Use AutoExec for Startup Actions and AutoNew for Template Documents
Result: AutoExec now handles startup automation, while AutoNew still works for template-based new documents.

Set Startup Macros in WPS Writer with AutoExec and AutoNew

Use the WPS Writer VBA editor to assign startup actions to AutoExec and template-new-document actions to AutoNew, so your macro runs at the correct moment without replacing Microsoft Word workflows.

  1. 1. Open WPS Writer: Launch WPS Writer and press Alt+F11 to open the macro editor.
  2. 2. Insert a module: Select the target template or Normal project and click Insert > Module.
  3. 3. Write AutoExec and AutoNew macros: Add Sub AutoExec() for startup actions and Sub AutoNew() for new documents created from a template.
  4. 4. Save as a macro-enabled file: Save the file in a macro-enabled format such as .docm or .dotm so the macros are retained.
  5. 5. Test the startup behavior: Close and reopen WPS Writer to verify that AutoExec runs at startup and AutoNew runs for template-based new documents.
Applies startup view and zoom settings reliably in WPS WriterDistinguishes AutoExec startup macros from AutoNew template macrosSupports Microsoft Word macro-enabled file formats such as .docm and .dotmProvides a familiar VBA editor interface for macro usersFree, lightweight alternative to Microsoft Word with strong compatibility
microsoft office alternative - wps office

Frequently Asked Questions

Why does AutoNew not run when WPS Writer starts with a blank document?

AutoNew is designed to run only when a new document is created from a template. The application startup with a blank document triggers AutoExec instead, so put startup actions in AutoExec.

What is the difference between AutoExec and AutoNew in Word macros?

AutoExec runs once when the application launches. AutoNew runs once when a new document is created from a template. AutoOpen runs when an existing document based on the template is opened.

Where do I place the AutoExec macro in WPS Writer?

Open the VBA editor with Alt+F11, select your Normal project or the relevant template in Project Explorer, insert a module, and create a Sub AutoExec() procedure.

Can I use AutoNew to set the view and zoom for all new documents?

AutoNew only covers documents created from the template that contains the macro. To cover startup blank documents and template-based documents, create both AutoExec and AutoNew procedures that call the same setting routine.

How do I make sure my macros are saved and enabled?

Save the file as a macro-enabled format such as .docm or .dotm, and check that macro security settings allow macros to run before reopening the document or template.