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.

Word
Word
A family of Microsoft word processing software products for creating web, email, and print documents.
736 questions
Office Open Specifications
Office Open Specifications
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Open Specifications: Technical documents for protocols, computer languages, standards support, and data portability. The goal with Open Specifications is to help developers open new opportunities to interoperate with Windows, SQL, Office, and SharePoint.
127 questions
{count} votes

Accepted answer
  1. Mike Bowen 1,516 Reputation points Microsoft Employee
    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