I stumbled across this great little project when refactoring some legacy web app code that was populating RTF file templates and stitching them together to create contiguous documents.
I'd love to use this little library but when rolling a little prototype I hit a snag. I took one of the old RTF templates, opened it in Word (Office 2010), saved it as a docx, converted it to the latest version, and then saved it again. Wrote a little console
app to read this new template twice then stitch the two copies together in a new docx using DocX.InsertDocument().
When I tried to open the new document in Word I get the following error:
The file Output.docx cannot be opened because there are problems with the contents.
Clicking 'Details' just shows:
The file is corrupt and cannot be opened.
Clicking OK gives you:
Word found unreadable content in Output.docx. Do you want to recover the contents of the document? If you trust the source of the document, click Yes.
Clicking Yes the file opens and looks OK, but there's no real indication of what was wrong with the structure. Obviously I need to get rid of the corrupt document warnings.
I think this is possibly the same issue that I saw another thread on here but there was no resolution. I've tried re-saving the corrupt document to see what Word changes (subsequent opens work fine) and there are additional files in the re-saved package.
Unfortunately I don't know enough about the structure of these docx packages to be much more help than that.
Can anyone help get me up and running with this? I'd be happy to help where I can, repro'ing the issue and testing fixes if required? I'd love to be able to replace that old code with this component ;)