Introduction
This source code is helpful to append set of documents and generate a single document.
Background (optional)
I have assigned a project in my company to generate a proposal that contains different sections. Each section will be presented in a separate word document. I have implemented this project using word interop services in .NET.
Using the code
The implementation is very simple. A line code has been used to append a set of documents. The code is,
oWord.Selection.InsertFile(strFile2,ref oObject,ref oObject,ref oObject,ref oObject)
To run this application you should have below references,
Microsoft Office 9.0 Object Library
Microsoft Word 9.0 Object Library
GenerateDocument Method
This method is designed to generate the appended document. In this, system gets the file names from the xml file And append the files one by one and present the final file. Page break has been implemented between each file that is inserted. The example project has been given in zip format.