Thanks for this tool, hopefully it can do wonders.
My problem here is to append N number of documents (docx) into 1 docx without opening MS word instance at all. I think the solution is,
i. Read 1st docx’s data (biforcate the structure and read it from the xml); similarly do this for N documents
ii. Copy any of the docx file and replace the xml content with appended content
but my doubt here is, how do i achieve this without opening the instance. I would like to have sample C# code for this so that i can develop taking that as a base.
Or is there any better solution? I shouldn’t take much time in doing the processing.
Thanks for your inquiry. You can easily combine documents using Aspose.Words. Here is simple code, which combines two document:
// Open documents.
Document dstDoc = new Document("dst.docx");
Document srcDoc = new Document("src.docx");
// Append source document to the destination document.
dstDoc.AppendDocument(srcDoc, ImportFormatMode.UseDestinationStyles);
// Save output document.
dstDoc.Save("out.docx");
Hope this helps. Please let me if you need more assistance, I will be glad to help you.
Best regards.
Hi,
Wondering is there any way to append word documents without creating the instance using C#…
I have 1.docx and 2.docx, I’ve to append the contents of these 2 to another file 3.docx without creating word instance.
Any thoughts? or Is this possible only with Aspose / Similar tools other than Word