Merging documents with ImportTemplate

Apr 8, 2010 at 7:23 AM


I would like to simply merge two docx documents so I'm using the <w:customXml element="ImportTemplate"> tag with the absolutepath attribute set to the second document, but the in the output document the customXml tag remains just without attributes.

Is this the correct way to merge two documents? What's wrong with this attempt?


Thank you

Apr 9, 2010 at 7:30 AM

You're using the wrong property to specify the template to be imported. Use 'uri' instead.
Check the documentation here:

Also: ImportTemplate will only import the main document part, so no headers and footers.


Apr 13, 2010 at 5:52 AM

Thank you, it works like a charm!