View Single Post
 
Old 07-15-2013, 07:29 AM
ajetrumpet's Avatar
ajetrumpet ajetrumpet is offline Windows Vista Office 2007
Novice
 
Join Date: Jul 2009
Location: Iowa City, IA
Posts: 11
ajetrumpet is on a distinguished road
Default help with compatibility of "WdSaveFormat" property of SaveAs method

Hi guys,

Does anyone know if there are any compatibility issues with this between office versions (2007 to anything newer)? I just tried to save a .docx file from a .dotx template file. I recorded a macro when doing it and this was the code that was produced:

Code:
  ActiveDocument.SaveAs FileName:="fileName.docx", FileFormat:= _
    wdFormatXMLDocument, LockComments:=False, Password:="", AddToRecentFiles _
    :=False, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts _
    :=False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
    SaveAsAOCELetter:=False
I ran this code to 'SaveAs' by opening a word template via VBA from Excel and doing the same thing. When I tried to open the new Word file (docx), I got this error:

The office open XML file [filename] cannot be opened because there are problems with its contents

do you guys know what might be happening here. It looks to me as though there are plenty of options, and of course MS is so great and documenting small things like this. Could I have done something wrong perhaps?

any help would be great. thanks!
Reply With Quote