We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Copy a content control from one docx to another docx

I am looking for a way to copy content control from one document to another. The content control contains text and images.

I am able to use the office ooxml SDK to copy the innerXML from one document to another and that works fine, however, it does not copy images (everything else copies fine). So I am wondering does ASPOSE have the capability to copy the entire contents of a control?

Any suggestions are appreciated.

Best, Mark

@markchequer Sure, you can copy nodes between the document. When you need to copy a node from one document into another, you essentially need to import the nodes of the source document into the destination one using the ImportNode method. After importing your nodes, you need to use the InsertAfter / InsertBefore / AppendChild / PrependChild methods to insert the imported node into the destination document.

Alexey, thank you for taking the time to answer. Simple answer, but it 100% helped me.

1 Like