Hello,
I have code that takes the contents of a userform (textboxes and listbox values) and inserts those values into the bookmarks of my .dotm template. It also inserts text from specified files based upon checkbox selections. All of that works fine but I am stumped by the SaveAs2 code that finalises the project.
The document cannot be opened after save.
The following error message is received;
"We're sorry. We can't open ***.docx because we found a problem with its contents"
it can only be opened if you change the extension to .docm
I have searched and searched to no avail - I think I might be missing something very fundamental. I have also noticed that if you open the resultant .docx document in the VBA editor it has a reference to my template document which contains the code.
This is the current iteration of the SaveAs2 code;
ActiveDocument.SaveAs2 FileName:="CurDir" & "DRAFT_RFQ_" & prName, _
FileFormat:=wdFormatXMLDocument, LockComments:=False, Password:="", _
AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, _
EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData _
:=False, SaveAsAOCELetter:=False, CompatibilityMode:=15
Any help would be greatly appreciated - Eastwick.