I'm trying to do a save-as with the following code in Word 2016:
Dim doc As Word.Document
Dim fpFile as string
Set doc = ActiveDocument
fpFile = doc.Path & "\" & doc.Name
doc.SaveAs Filename:=Left(fpFile, Len(fpFile) - 4) & "docx", FileFormat:=wdFormatDocument
My Filename argument using the Left and Len functions evaluates to:
C:\Users\My Name\Documents\My Company\My Client\test folder\HeaderTemplate.docx
This looks fine to me but I'm getting an error 6294: 'incompatible file type and file extension' on the SaveAs line.
I've tried putting the Filename to a string variable first and I've tried the SaveAs2 method, both with the same results. I do want to save as a standard non-macro-enabled docx file.
Any ideas?
Thanks.
FileFormat:=wdFormatDocumentDefault
– arcadeprecinct