Getting Started Programming Document-Level Customizations for Word
The features in this topic are available only if you have the required applications installed.
For more information, see.
If you are just getting started creating document-level customizations for Microsoft Office Word 2003 by using Microsoft Visual Studio 2005 Tools for the Microsoft Office System, here is what you need to know.
The Single Document Application Model
Each Word customization you create by using Visual Studio Tools for Office is based around a single document. To start using the customization, the end user opens the document or creates the document from a Word template. Events in the document, for example entering specific areas or clicking buttons and menu items, can call event-handling methods in the assembly. For more information, see.
Using Host Controls
There are new controls available that enable you to program directly against bookmarks and XML nodes the same way you program against controls on Windows Forms. These objects, called host controls, are based on native Word objects, but they are extended with new events and data binding capability. They appear as first-class objects in the programming model and in IntelliSense, which makes it easier to refer to specific objects directly in your code without having to walk through the Word object model.
Thecontrol is available on the Word Controls tab of the Toolbox in the Visual Studio designer, and you can also add bookmarks to a document the same way you do when you work with Word by itself. You add controls by mapping an XML schema to your document; the host controls are created automatically for each mapped element. For more information, see .
Using Data Binding
The Bookmark control is also in the list of controls that you can drag from the Data Sources window. Adding bookmarks in this way automatically binds them to the data source that you set up using the window. Without writing any code, you can display data from databases, Web services, and objects in your document. For more information, see.
For a list of topics that walk you through some of the common tasks in Word automation, see.