Set the Word VBA Save As Dialog Default to DOCX
Question details
Set a Word VBA Save As dialog to default to the standard DOCX format while allowing the user to choose a file name and location.

- Product
- Microsoft Word
- Device & OS
- not provided
- Scenario
- A VBA macro opens the Save As dialog using Application.Dialogs(wdDialogFileSaveAs).Show.
- Observed behavior
- The dialog defaults to the macro-enabled DOCM format instead of standard DOCX.
Open the document containing or using the macro, and make sure you can access its VBA code in the Visual Basic Editor. A standard DOCX file cannot retain VBA macros.
Set the Save As dialog format to standard DOCX
Set the dialog's Format property before displaying it so users can choose a name and location with DOCX as the initial format.
In Word, open the Developer tab and select Visual Basic. In the VBA editor, open the module containing the Save As macro.
Replace the existing dialog call with: With Application.Dialogs(wdDialogFileSaveAs) .Format = wdFormatXMLDocument .Show End With
Run the macro from Developer > Macros. In the Save As dialog, check that Word Document (*.docx) is selected, then choose a file name and location and select Save.

Work with Word documents in WPS Writer
WPS Office is a free, lightweight and easy-to-use alternative with a familiar interface and Microsoft Office format compatibility for a smooth transition. It does not fix Word-specific VBA dialog behavior, and macros should be tested separately.

Frequently Asked Questions
Which VBA constant selects standard DOCX?
Use wdFormatXMLDocument for a standard DOCX file. Set the Save As dialog's Format property to this constant before calling .Show.
Which constant selects a macro-enabled Word document?
Use wdFormatXMLDocumentMacroEnabled for the DOCM format when the saved document needs to retain VBA macros.
Can users still choose a different format?
Yes. Setting the dialog's Format property establishes the initial selection; users can change the file type in the Save As dialog before saving.
Will a DOCX file keep the document's VBA macros?
No. DOCX is a macro-free format. To retain macros in the saved document, choose Word Macro-Enabled Document (*.docm) in the Save As dialog.




