Saturday, April 14, 2012 11:34 AM
I am using altchunk to merge multiple docx, I need to keep each merged document inside a content control,in the merging process described by Brian Jones here The Easy Way to Assemble Multiple Word Documents content controls are removed afeter inserting the altchunk to get a valid document since altchunk element cannot be a child element of SdtBlock and only can be a child of : body (17.2.2); comment (184.108.40.206); docPartBody (17.12.6); endnote (17.11.2); footnote (17.11.10); ftr (17.10.3); hdr (17.10.4); tc (17.4.66) elements.
As a solution to keep content controls and getting a valid document i am adding a table cell to the content control then the altchunk is added as child to the table cell but i have problem with imported docx containing tables and borders , borders for these documents are truncated, so this solution cannot be used, what I need to know is, can I ignore the UnknownOpenXMLElement errors related to altchunk parent element, knowing that generated document will be opened in word (so errors are corrected by word) because I cant find another solution ?
- Edited by Tunisian_BB Saturday, April 14, 2012 12:28 PM correction
Monday, April 16, 2012 3:10 AMModerator
Thanks for posting in the MSDN Forum.
What's mean of "alchunk"? Do you clarify it?
Have a good day,
Tom Xu [MSFT]
MSDN Community Support | Feedback to us
Monday, April 16, 2012 7:55 AM
Monday, April 16, 2012 8:12 AM
I have never been using altchunks myself to do document merging but I thought this is a most robust solution. Maybe you do something wrong. You can also use Docentric to do document merging. This toolkit is basically a data driven document generation solution but it is also able to merge sub documents into a main document. It doesn't use altChunks technique to do merging but instead does merging of all parts of subdocument with the main document so I suppose you won't encounter the same problems as with your curent technique.
To do this with the toolkit you must create a template (main .docx document) and place the SubDocument elements (content controls with bindi) onto the template. Such an element can be placed anywhere in the template document. Then when generating the final document all SubDocument elements get replaced with the contents of the sub documents.
Thursday, April 19, 2012 8:16 AM
I dont want to use a commercial product.