How to SaveAs in Word 97 using Word version 12 component?

673 views Asked by At

I'm using the Word 2007-component in C#.

I want to save the Word document as a Word97(-2003)-document, because not everyone uses Word 2007/2010.

I thought it is easy by using the following command

document.SaveAs(AFullFileName, WdSaveFormat.wdFormatDocument97);

But then the SaveAs-dialog is shown with the assumption that I want to save it as a docx-file.

SaveAs Dialog

I've noticed that the WdSaveFormat.wdFormatDocument-flag has had the same value as WdSaveFormat.wdFormatDocument97-flag. So I think I have to do more then only using those parameters in the SaveAs-command.

Can anybody help me? I would like the format to be correct and not to see the Save As dialog.

Thanks.

2

There are 2 answers

7
Petr Abdulin On BEST ANSWER

As already suggested in comments most probably you must check that save file name, (i.e. AFullFileName argument) extension is properly set to .doc, not .docx. Word enforces that for security reasons.

2
user1531040 On

I've solve this by saving the document under another filename.

I tried to save the file as doc-file by using Word 2007. But it seems that the file can't be overwritten. I tried to change the type of Save As. I chose several times Word97-doc. But nothing was saved. And everytime the type turns back as a docx-document.

And finally when I change the filename, the document saved as a Word97-document.