I'm running a save macro where in it I've got a line:
Format(ActiveDocument.FormFields("aReviewDate").Result, "yymmdd") & _
".docm"
I'm trying to get the document to save as a .docm but each time it's saved it reverts back to a .docx.
What can I add to it to make it save as a .docm???
I'm using a cut and paste version of some old code and in that code I forced it to save as a .doc by using:
.Format = wdFormatDocument97
But I don't know how to write it so it formats it as a .docm. Am I on the right path? Can someone help please?
Thanks!
-Dax
Little VBA Help
-
- 3StarLounger
- Posts: 368
- Joined: 04 Jan 2012, 22:43
Little VBA Help
It takes 2 to tango; unless you speak binary; then it takes 10.
-
- Administrator
- Posts: 78536
- Joined: 16 Jan 2010, 00:14
- Status: Microsoft MVP
- Location: Wageningen, The Netherlands
Re: Little VBA Help
Try this:
Code: Select all
ActiveDocument.SaveAs FileName:=Format(ActiveDocument.FormFields("aReviewDate").Result, "yymmdd") & ".docm", _
FileFormat:=wdFormatXMLDocumentMacroEnabled
Best wishes,
Hans
Hans
-
- 3StarLounger
- Posts: 368
- Joined: 04 Jan 2012, 22:43
Re: Little VBA Help
Actually,
.Format = wdFormatXMLDocumentMacroEnabled
works perfect! Thanks Hans!!
.Format = wdFormatXMLDocumentMacroEnabled
works perfect! Thanks Hans!!
It takes 2 to tango; unless you speak binary; then it takes 10.