Macro Code for bringing up Save As dialog box and changing file Type


Joined
Apr 24, 2016
Messages
1
Reaction score
0
I'm trying to create a Macro for opening the Save As dialog box, so I have this:

Dialogs(wdDialogFileSaveAs).Show

Which seems to work great. However, I would like to change the File format to .docx instead of .docm. Currently the default one in the Save-As dialog box is showing as a macro-enabled document. I tried to fiddle around with FileFormat, but couldn't get it to work with the Show Dialog from above.

I did have this code working, which changed the file format to .docx, but now I would like it not to save it for me, but to allow me to change the file name and file location manually (by opening the FileSaveAs dialog box), but I still want it to change the file format.

ChangeFileOpenDirectory _
"D:\Company\Team Files\TECH\"
ActiveDocument.SaveAs2 FileName:="Macro templates.docm", _
FileFormat:=wdFormatXMLDocumentMacroEnabled, LockComments:=False, _
Password:="", AddToRecentFiles:=True, WritePassword:="", _
ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _
SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _
False, CompatibilityMode:=15
 
Ad

Advertisements


Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top