Template Issues

Automatically Save New Microsoft Word Template Documents to a Folder

John WilsonJohn Wilson Nov 13, 2026 868 views

Question details

Set up a Word template so new documents can be saved to a designated folder.

Automatically Save New Word Template Documents to a Specific Folder
Product
Microsoft Word
Device & OS
not provided
Scenario
A user creates documents from a template and wants them saved in a dedicated folder rather than the default location.
Observed behavior
Each new document should prompt for a file name and save to the chosen folder.
Before you start

Create the destination folder and note its full path. The example below uses a Windows path; the template must be macro-enabled and trusted for its AutoNew macro to run.

Solution 1Recommended

Add an AutoNew macro to the Word template

Use a macro-enabled template to prompt for a name and save each newly created document to a specified folder.

AutoNew runs when a new document is created from the template, not when an existing document is opened. The example saves new documents as macro-free .docx files.

1
Open the template for editing

In Word, select File > Open and open the template itself. If needed, use File > Save As and choose Word Macro-Enabled Template (*.dotm).

2
Insert a macro module

Press Alt+F11 to open the Visual Basic Editor. In the template's project, select Insert > Module.

3
Add the AutoNew code

Paste the following code into the module. Replace C:\Reports\ with the full path of an existing folder, keeping the trailing backslash: Sub AutoNew() Dim folderPath As String Dim fileName As String Dim fullPath As String On Error GoTo SaveError folderPath = "C:\Reports\" fileName = Trim(InputBox("Enter a file name without an extension:")) If fileName = "" Then Exit Sub fullPath = folderPath & fileName & ".docx" If Dir(fullPath) <> "" Then MsgBox "A file with that name already exists. The document was not saved." Exit Sub End If ActiveDocument.SaveAs2 FileName:=fullPath, FileFormat:=wdFormatXMLDocument Exit Sub SaveError: MsgBox "The document could not be saved. Check the folder path and file name." End Sub

4
Save and trust the template

Save the .dotm template. If necessary, in Word select File > Options > Trust Center > Trust Center Settings > Trusted Locations and add a folder you control, then place the template there. Trust only templates and locations you know are safe.

5
Create and test a document

Create a new document from the template, for example by double-clicking the .dotm file. Enter a file name without an extension and check the destination folder for the new .docx file.

Add an AutoNew macro to the Word template
If the prompt is canceled: The document remains unsaved if the name is blank, the target file already exists, or saving fails. Use File > Save As to save it manually.
Free Microsoft Office alternative

Create and Save Template-Based Documents in WPS Writer

WPS Office is a free, lightweight alternative with a familiar interface and Microsoft Office format compatibility. Open compatible documents, create new files from templates, and choose a destination folder when saving. Word's AutoNew macro behavior is not guaranteed in WPS Writer.

Create documents from templates and choose a save folderOpen and save Microsoft Word formats such as .docxFamiliar editing interface for an easier move from OfficeFree and lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Why doesn't the AutoNew macro run?

Check that the macro is in a standard module in the .dotm template and that the template is trusted. AutoNew runs when you create a new document from the template, not when you open an existing document.

Can I use a different destination folder?

Yes. Edit the folderPath line in the Visual Basic Editor and enter the full path of an existing folder. The Windows example requires a trailing backslash.

What happens if a document with the same name already exists?

The example displays a message and leaves the new document unsaved instead of overwriting the existing file. Use File > Save As to choose another name.

Does the new document retain macros?

No. The example saves the new document as a macro-free .docx file. The AutoNew macro remains in the .dotm template.