I have created a Document using AltChunk, It works well. Also able to see my content properly.
But when I tried to read the Document content using openXML. The InnerText
is null
and when I zip the document the document added using AltChunk are showing over there.
Is there any way to get the content using OpenXML so that I could verify the final document?
AltChunk
embeds content files into the master file. The master file'sdocument.xml
has a simple tag with a relation id pointing out to one of the relations files (document.xml.rels
or[Content_Types].xml
), which then points to the embedded entry file.The work of merging the documents is handled by the word processor the first time that a file containing
AltChunk
markup is opened and re-saved.If you need to work with the master file after embedding the content files, you have a few options:
Trust
AltChunk
:Ask Word for some help:
Roll your own:
When in doubt, you can always drop into the raw OpenXML markup with the LINQ-toXML. From experience, I can say that this is a great deal more work. Without the OpenXML SDK, you are responsible for managing a complex structure of intertwined XML files.
For a recent project, I built a system to read, process, combine, reprocess, and save dozens of
.docx
files. Working in the raw markup offered us complete control without requiring an installation of Word or additional dependencies. That said, the time required to implement a robust system for merging non-trivial documents should be measured in person-weeks, if not person-months.