![]() If we need to add a new document file, first we have to create an instance of the Word.Document object and then add it to the Word.Application. Creating a new instance of Word.Application can be visualized as below. This is like the base class which is needed to create a new document. This represents in Word Application without any new document loaded in it. The Word.Application and Word.Document are used to Open Word and add a new Document to it. The same steps needs to be done programmatically. ![]() (Opening Word Application creates a new document by default, but in Automation, wee need to manually add a document) ![]() Let's consider that we want to create a document using the Word Application, we might end up doing the following steps, Note: This DLL would be present only if Microsoft Office is installed on the Machine.Īlso include "using Microsoft.Office " in the Namespaces used.Īll the methods used Word automation is derived either from Word.Application or Word.Document class. This DLL has all the methods which we do to perform the automation. This can be done by right clicking the Reference Folder in the Solution explorer of the project and select Add Reference.īrowse Through the available COM objects and Select Microsoft Office 11.0 Object Library & Microsoft Word 11.0 Object Library. Starting off, the first step is to include the Word DLL's to the Solution. Tasks like Inserting Table of Contents, Linking documents, Mail Merge, Inserting Documents, Embedding documents, inserting pictures, watermark. Almost all of the tasks which we perform on word 2003 can be done programmatically using C# or VB. Word automation almost completely involves working with objects and reference types. ![]() Working on Word is considered to be straightforward, but doing the same programmatically gets a little intricate. Word Automation through C# is all about programmatically generating the Word Document using C# code.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |