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

Free Support Forum - aspose.com

Adding Table from one document into another document (at bookmark)

Hi there,


We are using Aspose Words for .Net (v 10.3.0.0, dated : 2011.07.30).
Using VS 2010, .Net 3.5, MS Word 2007/2010.

Requirement:
I have one document which is a big DOCX file containing many bookmarks. I have full control if I need to modify this. ( Doc1)
I have second document which contains only one Table. (Doc2) From my code I want to populate this table. I only want to populate table and don’t want to create whole table in Doc1 by code. I will use Doc2 to populate same table with different data and put it (replace Doc1’s bookmark) in Doc1 many time. In short, Doc1 will show me same table(look and feel) many time at different places ( depend on data ).

Problem:
When I use AppendDoc “builder.Document.ImportNode” it appends at the end of document ( fair enough),but that’s not what I want. I want to replace that populated table into bookmark. If I try to do that then it gives me an error "The newChild was created from a different document than the one that created this node."

Help:
If you can provide me help/link/code on my scenario it will be really appreciated.

Thanks.

Looking forward to see your quick reply.


Hi Ankit,


Thanks for your inquiry. I think, you can achieve what you need after reading the article suggested below:
http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/howto-insert-a-document-into-another-document.html

Moreover, for a description of the exception i.e. “The newChild was created from a different document than the one that created this node.”, please refer to the following post:
<a href="

Please let us know if you need more information, We are always glad to help you.

Best Regards,