Free Support Forum - aspose.com

Not Keep format when insert document in another

Hi,


I have a problem when I try insert a document in another because the result lost part of text format.

I send source code and documents for try to reproduce because I don’t know if is a code problem or a bug.

Thanks for all.

Best regards,

Hello

Thanks for your request. As I can see there is no bookmark with “M1” name inside your documents. Also could you please attach your output document here for testing, and describe in more detailed way what the problem you are observing.

Best regards,

Hi,


excuse the documents are wrong. Now I send you the new example.

The problem is this:

Document 2.docx content a paragraph with 2 columns but when I replace bookmark (in 1.docx) with content document 2.docx It’s lose the format paragraph (I don’t see 2 columns).

I hope you understand my explanation:)

Thanks for all,

Best regards.

Hi,


I attach the new example.

Thanks for all.

Best regards,

Hello

Thank you for additional information. First of all, I would like that you try inserting the one document into the bookmark of another document using MS Word. You will see the resulting document has two columns but not in the same way as the original document.

Regarding code, I think in your case you should check which section has more than one TextColumn and then apply this formatting to the destination document. You can check TextCollumn count using CurrentSection.PageSetup.TextColumns.Count:

http://www.aspose.com/documentation/.net-components/aspose.words-for-.net/aspose.words.pagesetup.textcolumns.html

And one more thing, I think you can try using table instead of text columns.

Best regards,