Word document is corrupt for unknown reason

Connor Shore 186 Reputation points
2023-04-07T15:50:06.04+00:00

Hello, I have a Word document that was generated using our product that is corrupt for an unknown reason. Their input file is a docm file and I have a docx and a docm output file which says it is corrupt. I have run both documents through an OOXML validator and the validator says both files are correct. A customer of ours needs this fixed so if you guys are able to figure out what is wrong with these files then I'll be able to make a change to our output engine to fix whatever is causing the output file to be corrupted. Any help is much appreciated. CorruptOutput.docm.txt CorruptOutput.docx.txt Thank you, Connor PS NOTE: I've added a .txt extension to the files so it would allow me to attach the files to this ticket.

Microsoft 365 and Office | Open Specifications
Microsoft 365 and Office | Word | For business | Windows
{count} votes

Accepted answer
  1. Mike Bowen 2,051 Reputation points Microsoft Employee Moderator
    2023-04-14T19:19:39.05+00:00

    Hi @Connor Shore ,

    I have investigated this further and you are correct the issue is the macros saved in docx. You cannot save macros to a docx file. To make the .docx valid, you will need to make the fixes to the xml in document.xml described in my fix for your docm and remove all macros and related parts and relationships from the .docx file and change its ContentType to application/vnd.openxmlformats-officedocument.wordprocessingml.document.main+xml

    Please let me know if this answers your questions.

    Mike Bowen Escalation Engineer - Microsoft Open Specifications

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.