Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Append Word documents using interop services

0.00/5 (No votes)
12 May 2005 1  
An article on Word append using interop.

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.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here