I'm generating a MS Word document with OpenXml package in C#. Many times I've seen this erorr message:
This error message is pretty useless: all it says the problem is in footer. Most of the times it says the error is on line 1, char 1.
I usually find the problem, but it takes too much time by going back and forth.
Are there any tools/techniques that can help with debugging such errors? Show a better error, like you are trying to add a Text outwith of a Run, or something like that?
After poking a bit more online, I found tools that eased the pain. Even made a blog post about it: http://tech.trailmax.info/2014/04/validating-of-openxml-generated-documents-or-the-file-cannot-be-opened-because-there-are-problems-with-contents/
The basics are here:
OpenXmlValidator
class. Use it like this: http://msdn.microsoft.com/en-us/library/office/bb497334%28v=office.15%29.aspx
If you know other(better) ways, please let me know!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With