Guide for VB.NET
Core Document Formats
Additional Features

VB.NET Word - Merge Word Documents Using VB

Tutorial with VB Codes for Merging Word Documents in .NET Application

VB.NET
Home > .NET Imaging SDK > VB.NET > Merge Word
To get started with DocImage SDK for .NET, you are supposed to read VB.NET Imaging: Get Started first!

VB.NET Word Document Merging Control contained in our .NET Imaging SDK is available in Microsoft Office for combining several separate Word documents into one. Traditionally, if you want to make several Word documents together in one document, you will always complete this by copying and paste one document into another and this will be time-wasting and tedious. With our VB.NET Word Document Merging Control, you just need to compile some VB.NET codes into your Visual Studio application to achieve Word documents merging.
Related .net document control helps:
document viewer asp.net c#: ASP.NET Document Viewer using C#: Open, View, Annotate, Redact, Convert document files in ASP.NET using C#, HTML5, JQuer...
powerpoint viewer asp.net mvc: ASP.NET PowerPoint Document Viewer Control (MVC & WebForms): view ppt, pptx files online in C# using ASP.NET
asp.net pdf document viewer: ASP.NET PDF Document Viewer in C#: open, display, view, annotate, redact Adobe PDF files online in ASP.NET MVC & WebForm...
asp.net dicom web viewer: ASP.NET Dicom Document Viewer Control: view, annotate dicom imaging files online in ASP.NET
asp.net view text file: ASP.NET Text file viewer in MVC, WebForms: Open, view, annotate, convert txt files in C# ASP.NET
asp.net pdf editor control: EdgePDF: ASP.NET PDF Editor Web Control: Online view, annotate, redact, edit, process, convert PDF documents
asp.net edit pdf text color: ASP.NET PDF Text Edit Control: online edit PDF text content using C# ASP.NET
If you often cope with Word documents during work, you will know that it is common to merge multiple Word documents into one. However, Microsoft Word does not include a function of combining more than one Word documents into a single one. Therefore, if you have a demand of merging Word documents, a Word Document Merging Library is needed. RasterEdge provides such a library that enables to combine two or several Word documents in VB.NET application.
Apart from Word document merging function in VB.NET, our .NET Imaging SDK provides more Word processing functions. These functions are commonly used by VB.NET developers and you may find your needed function control. Here is a list of main Word processing functions supported by our .NET Imaging SDK in .NET applications using VB language.
  • Support to add or delete pages from a Word document in VB.NET
  • Able to extract text from a Microsoft Word document using VB class
  • Capable of rotating Word document pages through VB.NET programming
  • Enable VB.NET developers to split pages of a Word document
  • Support to print certain page of a Word document or the whole document in VB.NET
Merge Two Word Documents in VB.NET
Wondering how to merge two Word documents into a single file? Here is a simple VB.NET solution for combing two Word documents with our Word Document Merging Control. To use this Control, you need to install Visual Studio 2005 or later versions and .NET Framework 2.0 or above. Two dlls in this VB.NET Word Document Merging Library trial package should be added to your project references: RasterEdge.Imaging.Basic.dll and RasterEdge.Imaging.MSWordDocx.dll. Then, you can copy the following VB code to merge your two Word documents.
     Imports RasterEdge.Imaging.Basic
Imports RasterEdge.Imaging.Basic.Core
Imports RasterEdge.Imaging.Basic.Codec
Imports RasterEdge.Imaging.MSWordDocx

Namespace RE__Test
Public Partial Class Form1
Inherits Form
Public Sub New()
InitializeComponent()
End Sub

Public Shared FolderName As String = "c:/"

Private Sub button1_Click(sender As Object, e As EventArgs)
Dim fileName1 As String = FolderName & "Sample1.docx"
Dim fileName2 As String = FolderName & "Sample2.docx"
Dim fileNameMerged As String = FolderName & "Merged.docx"

Dim doc1 As REDocument = REFile.OpenDocumentFile(fileName1, New DOCXDecoder())
'use DOCXDecoder open one word file
Dim doc2 As REDocument = REFile.OpenDocumentFile(fileName2, New DOCXDecoder())
'use DOCXDecoder open another word file
Dim docMerged As BaseDocument = doc1.MergeDocument(doc2)
'merge two word
REFile.SaveDocumentFile(DirectCast(docMerged, REDocument), fileNameMerged, New DOCXEncoder())
'save new word
End Sub

End Class
End Namespace
Merge Multiple Word Documents in VB.NET
Our VB.NET Word Document Merging Library is also designed to help you merge more than two Word documents into a single file through VB.NET programming. Similar to two Word documents combination, RasterEdge.Imaging.Basic.dll and RasterEdge.Imaging.MSWordDocx.dll two dlls are required. After building your project in Visual Studio using VB language and adding references to it, you are able to use free sample code below for combining multiple Word documents.
     Imports RasterEdge.Imaging.Basic
Imports RasterEdge.Imaging.Basic.Core
Imports RasterEdge.Imaging.Basic.Codec
Imports RasterEdge.Imaging.MSWordDocx

Namespace RE__Test
Public Partial Class Form1
Inherits Form
Public Sub New()
InitializeComponent()
End Sub

Public Shared FolderName As String = "c:/"

Private Sub button1_Click(sender As Object, e As EventArgs)
Dim fileName1 As String = FolderName & "Sample1.docx"
Dim fileName2 As String = FolderName & "Sample2.docx"
Dim fileName3 As String = FolderName & "Sample3.docx"
Dim fileNameMerged As String = FolderName & "Merged.docx"

Dim doc1 As REDocument = REFile.OpenDocumentFile(fileName1, New DOCXDecoder())
Dim doc2 As REDocument = REFile.OpenDocumentFile(fileName2, New DOCXDecoder())
Dim doc3 As REDocument = REFile.OpenDocumentFile(fileName3, New DOCXDecoder())
Dim docMerged As BaseDocument = doc1.MergeDocument(doc2)
Dim docMerged As BaseDocument = doc2.MergeDocument(doc3)
'merge three word documents
REFile.SaveDocumentFile(DirectCast(docMerged, REDocument), fileNameMerged, New DOCXEncoder())
'save new word
End Sub

End Class
End Namespace
In the above part, we have discussed how to merge Word documents in VB.NET. And if you want to merge Word documents in Visual C#.NET, you can use our C#.NET Word Document Merging Control. It is easy to use and a user manual is provided to help you apply it into your C#.NET applications.
VB.NET Word Doc Merging Control Feedbacks
Our VB.NET Word Document Merging Control is widely by developers and some of them have given us some feedbacks.
Your VB.NET Word Document Merging Control can be easily integrated into my VB.NET application. With the user-friendly interface, I am able to install it for usage independently. -- Cecil
It allows me to combine multiple Word documents into one in VB.NET project. Quite useful! Thanks a lot. -- Evan
This Word Document Merging Library for VB.NET evaluation version is costless. Unfortunately, it cannot be used in commercial applications. -- Andy
More Tutorials!
Find more user guides with RasteEdge .NET Word SDK using VB.NET sample codings!


Recommend this to Google+


RasterEdge.com is professional provider of ASP.NET MVC Document Viewer, ASP.NET PDF Viewer, MVC PDF Viewer document, content and imaging solutions, available for ASP.NET AJAX, Silverlight, Windows Forms as well as WPF. We are dedicated to provide powerful & profession imaging controls, PDF document, image to pdf files and components for capturing, viewing, processing, converting, compressing and stroing images, documents and more.

©2000-2017 Raster Edge.com