How to insert one document into another using .NET

I am inserting a document using code from a previous forum post InsertDocumentAtBookmark() with two columns into a single column document but the new document now has single columns only.

Is there a way to insert a document using either the builder.pagesetup or builder.Currentsection.pagesetup.textcolumns.setcount(2) and have the new document retain the settings?

Thanks
Keith

Hi Keith,


Thanks for your inquiry. Could you please attach the following documents here for testing.

1) Template document - that contains the Bookmark at where the new document is to be inserted.
2) Source document - the ‘two column’ document you need to insert inside the template document.
3) Target document - I will investigate as to how you are expecting your final document to be generated like. You can use MS Word to create your target Word document.

Moreover, I would suggest you please read the following article on inserting one document into another document:
http://www.aspose.com/docs/display/wordsnet/How+to++Insert+a+Document+into+another+Document

Best Regards,

Hi Keith,

Thanks for your query. It would be great if you please share some more information about your query along with source document. Please read following documentation link for your kind reference.

http://www.aspose.com/docs/display/wordsnet/How+to++Insert+a+Document+into+another+Document

Thanks for your reply,

I have enclosed documents as requested.

Keith

Hi Keith,

Thanks for sharing the documents. Please use the following code snippet for your requirement. Please let us know if you have any more queries.

Document  outdoc = new spose.Words.Document(MyDir + “Template.doc”);

Document source = new Aspose.Words.Document(MyDir + "Source.doc");

DocumentBuilder builder = new DocumentBuilder(outdoc);

builder.MoveToBookmark("TOC");

builder.CurrentSection.PageSetup.TextColumns.SetCount(2);

InsertDocument(builder.CurrentNode.ParentNode, source);

outdoc.Save(MyDir + "AsposeOut.docx");

The issues you have found earlier (filed as WORDSNET-5251) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(2)