Word Documents with Invalid Format

Add-in Express™ Support Service
That's what is more important than anything else

Word Documents with Invalid Format
 
Mark Stevens




Posts: 36
Joined: 2014-09-15
I know this is nothing to do with ADX, as far as I know, but wondering if the wealth of knowledge here had a thought on on this.

This is only happening with some users, not all, on the latest Windows 10 and latest Office 2016. It's also something I can't reproduce even using their actual documents.

They have a Word 97 .doc document which edits fine as it is but when they click a button on mine which saves it as a .docx like so:
     
WordApp.ActiveDocument.SaveAs(sFileName, wdFormatDocumentDefault, EmptyParam, EmptyParam,
                              EmptyParam, EmptyParam, EmptyParam, EmptyParam, EmptyParam,
                              EmptyParam, EmptyParam);

After this the document has the .docx extension but Word refuses to open it again saying the file format doesn't match the extension.

Digging deeper, I looked at the file and found that it still looks like a regular .doc file inside except the FIB part of the file has: EC A5 44 01 (EC A5 C1 00 is what a regular .doc Word 97 format would have). I can't find anything regarding what this version 44 01 (324) is?

So instead of saving it as .docx, it seems to have saved it in some other format? Note, the option for the default format is .docx as well if that makes any difference.

Should I be saving the file some other way? Any ideas how this could happen?

Thanks
Posted 16 Jun, 2018 08:11:31 Top
Andrei Smolin


Add-in Express team


Posts: 15574
Joined: 2006-05-11
Hello Mark,

Mark Stevens writes:
After this the document has the .docx extension but Word refuses to open it again saying the file format doesn't match the extension.


You should save this document under a different name; the new file name should have the ".docx" extension.

In what Word version do you see this issue?

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 18 Jun, 2018 04:10:57 Top