View Single Post
 
Old 10-10-2014, 05:25 AM
Madbags Madbags is offline Windows 7 64bit Office 2013
Novice
 
Join Date: Oct 2014
Posts: 1
Madbags is on a distinguished road
Default Set File Type when clicking Save As

Hi,

I'm encountering an issue with my Macro.

I have got it to work thus far to remove the Read Only status and clear the password boxes when someone opens the document using AutoOpen so when someone clicks "Save As" they do not then need to remove the read only status.

Code:
 
Public Sub AutoOpen()
With Dialogs(wdDialogFileSaveAs)
ActiveDocument.ReadOnlyRecommended = False
ActiveDocument.Password = ""
ActiveDocument.WritePassword = ""
End With
End Sub
Now this code words fine but what I don't want is people then saving this as a Macro Enabled Word Document after by accident so I would like either when "Save As" is clicked or when the document opened for it to automatically choose .Docx / Word Document. I don't need the filename ot change or anything just this.

Now I tried adding

Code:
ActiveDocument.SaveAs2 FileFormat:=wdFormatXMLDocument
and it seems to run the code and change it but when I save it and close Word the document can no longer be opened, with no specified error.

Can anyone help, or maybe produce something better, that works?

Thanks
Reply With Quote