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

Free Support Forum - aspose.com

How to merge many Word documents into a big one?

Hi, Support,

How to merge many Word document into a big one by aspose.words.dll (version 14 or 19) and based on VB.net?
I work it by this code like:

            Dim MergeDoc As New Global.Aspose.Words.Document()
            MergeDoc.RemoveAllChildren()
            Dim MergeBuiler As New Global.Aspose.Words.DocumentBuilder(MergeDoc)
           Dim doc1 = new Global.Aspose.Words.Document(MyDir + "Input0.docx")
           Dim doc2 = new Global.Aspose.Words.Document(MyDir + "Input1.docx")
           Dim  doc3 = new Global.Aspose.Words.Document(MyDir + "Input2.docx")
            Dim Para As Global.Aspose.Words.Paragraph = MergeBuiler.getCurrentParagraph() 

’ This doesn’t work for getCurrentParagraph is not available.
insertDocument(para, doc1) 'This doesn’t work for insertDocument is not available.
MergeBuiler .moveToDocumentEnd()
para = MergeBuiler .getCurrentParagraph()
insertDocument(para, doc2)
MergeBuiler .moveToDocumentEnd()
para = MergeBuiler .getCurrentParagraph()
insertDocument(para, doc3)
finalDocument.save(MyDir + “Out.docx”)

Thanks for your help!

Ducaisoft

@ducaisoft,

Please refer to the following sections of documentation:

Joining and Appending Documents
How to Insert a Document into another Document

Hope, this helps.