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

Free Support Forum - aspose.com

How do I copy a table from one doc to another

using aspose.word for .Net

Hi<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Thanks for your request. You should use ImportNode method in this case. Please follow the link to learn how to import nodes from one document to another.


Also, see the following code snippet:

//Open source and destination documents

Document srcDoc = new Document(@"Test169\srcDoc.doc");

Document dstDoc = new Document(@"Test169\dstDoc.doc");

//Get some table from source document

Table srcTab = srcDoc.FirstSection.Body.Tables[0];

//Import table node into the destination document

Node dstNode = dstDoc.ImportNode(srcTab, true, ImportFormatMode.KeepSourceFormatting);

//Insert it into the document


//Save document


Best regards.