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

Free Support Forum - aspose.com

Insert document into another document without losing section information


I would like to be able to insert other documents into my main document at specific fields. I followed the instructions on https://docs.aspose.com/words/java/insert-and-append-documents/. The code works very well, but one of my documents uses sections (it contains a two-column text part) and the code given by Aspose to insert a document into another just copies the nodes but looses all section information.

Is it possible to copy the section information from one document while inserting it into another?

Thanks in advance,


Hi Thomas,

Thanks for your query. Please use the following code snippet to insert one document to another. If you still face the problem, please share your documents for investigation purposes.

Document doc = new Document(DirDoc + @"in.doc");
Document Append = new Document(DirDoc + @"Append.doc");
doc.AppendDocument(Append, ImportFormatMode.KeepSourceFormatting);
doc.Save(DirAsposeOut + @"out.Doc", SaveFormat.Doc);