Merging word files?

Hello,

I am interested to know if any of your products ( maybe Aspose.Words ) could merge multiple word files ( doc / docx ) into a single word file.
I would also want to know how the formats are interpreted as file1 could have a different format structure ( margins , etc ) compared to file2. So I’m interested to know how the end result of this merge is considering these key properties. Things that interest me are how it handles the merging properties margin/indent/formats/font styles/ font size/ alignment/ page numbering/ header handling/ table of contents/ images positioning/ page breaks, etc.

Please let me know if any of your product support word files merging and how the end product result is formatted.

Kind Regards,
Alan

Hi Alan,

Thanks for your inquiry.

AlanKinder:
I am interested to know if any of your products ( maybe Aspose.Words ) could merge multiple word files ( doc /
docx ) into a single word file.

With Aspose.Words, you can merge multiple Word files. Please use Document.AppendDocument method to append the specified document to the end of this document. Following code example shows how to append a document to the end of another document.

// The document that the content will be appended to.
Document dstDoc = new Document(MyDir + "Document.doc");
// The document to append.
Document srcDoc = new Document(MyDir + "DocumentBuilder.doc");
// Append the source document to the destination document.
// Pass format mode to retain the original formatting of the source document when importing it.
dstDoc.AppendDocument(srcDoc, ImportFormatMode.KeepSourceFormatting);
// Save the document.
dstDoc.Save(MyDir + "Document.AppendDocument Out.doc");

AlanKinder:
I would also want to know how the formats are interpreted as file1 could have a different format structure ( margins , etc ) compared to file2. So I’m interested to know how the end result of this merge is considering these key properties. Things that interest me are how it handles the merging properties margin/indent/formats/font styles/ font size/ alignment/ page numbering/ header handling/ table of contents/ images positioning/ page breaks, etc.

We suggest you please read following articles about joining and appending documents.
Appending Documents Overview
How the AppendDocument Method Works
Differences between ImportFormat Modes
Specifying How a Document is Joined Together