I inserted a QR picture into .docx file with OpenXml sdk 2.0. but sometimes, the created document cannot open, and prompt the message above.
I compared the document that work with document that don't work with openxml sdk productivity tool, only a few difference that look harmless (I am new to OpenXml).
Unlike other thread on the web, my error message says Line:0,Column:0 .
How can I know what's wrong?
Update: The Word client version is 2016. I had not tried 2013 yet. I just download WPS 2019 for test and it can open the "corrupt" .docx file.
But I still don't know what makes ms word think the file is corrupt and how can it be created and saved with openxml.
By the way, wordprocessingdoc.MainDocumentPart.AddImagePart(ImagePartType.Png) does not work on my environment, so, I followed sugguest from https://stackoverflow.com/questions/18569113/open-xml-sdk-addimagepart-change-image-location-from-media-to-word-mediato add the image file into zip package and it works.
Update: I tried Word 2013 on a win 7 computer. It behave the same as Word 2016 on win 10 for this issue.I posted in another forum:
https://social.msdn.microsoft.com/Forums/en-US/92a94048-3339-4943-90e0-03fe8d0632a9/cannot-open-docx-after-inserting-picture-with-openxml-problem-with-partworddocumentxml65292?forum=os_binaryfile#92a94048-3339-4943-90e0-03fe8d0632a9