Free Support Forum -

How to insert a document's body into another document

I have two DOCX document, one of them (let's call it A) containing a placeholder like "#HERE#". I want to open A, find the placeholder (so far no problem, I found the Run containing #HERE#) and replace it with the contents (only the body, not header, footer oder metadata) of document B.

Is this possible? I guess, I have find some kind body root node in document B and append all it's children to the parent of the Run in document A, is this correct?

Do you have some sample code, that does this or something similar?


Thanks for your request. I think in this case you can try using the InsertDocument method provided in this article:

Please let me know in case of any issues. I will be glad to help you.

Best regards,

Thanks, that did it :slight_smile: