Skip to main content
Word Solutions
 

Visual Studio provides project templates you can use to create document-level customizations and VSTO Add-ins for Microsoft Office Word. You can use these solutions to automate Word, extend Word features, and customize the Word user interface (UI). For more information about the differences between document-level customizations and VSTO Add-ins, see Office Solutions Development Overview (VSTO).

Applies to: The information in this topic applies to document-level projects and VSTO add-in projects for Word. For more information, see Features Available by Office Application and Project Type.

System_CAPS_ICON_note.jpg Note


Interested in developing solutions that extend the Office experience across multiple platforms? Check out the new Office Add-ins model. Office Add-ins have a small footprint compared to VSTO add-ins and solutions, and you can build them by using almost any web programming technology, such as HTML5, JavaScript, CSS3, and XML.

This topic provides the following information:

  • Automating Word.

  • Developing document-level customizations for Word.

  • Developing VSTO Add-ins for Word.

  • Customizing the user interface of Word.

The Word object model exposes many types that you can use to automate Word. For example, you can programmatically create tables, format documents, and set the text in ranges and paragraphs. For more information, see Word Object Model Overview.

When developing Word solutions in Visual Studio, you can also use host items and host controls in your solutions. These are objects that extend certain commonly used objects in the Word object model, such as the Microsoft.Office.Interop.Word.Document and Microsoft.Office.Interop.Word.ContentControl objects. The extended objects behave like the Word objects they are based on, but they add additional events and data binding capabilities to the objects. For more information, see Automating Word by Using Extended Objects.

A document-level customization for Microsoft Office Word consists of an assembly that is associated with a specific document. The assembly typically extends the document by customizing the UI and by automating Word. Unlike a VSTO Add-in, which is associated with Word itself, functionality that you implement in a customization is available only when the associated document is open in Word.

To create a document-level customization project for Word, use the Word Document or Word Template project templates in the New Project dialog box of Visual Studio. For more information, see How to: Create Office Projects in Visual Studio.

For more information about how document-level customizations work, Architecture of Document-Level Customizations.

Word Customization Programming Model

When you create a document-level project for Word, Visual Studio generates a class, called ThisDocument, which is the foundation of your solution. This class represents the document that is associated with your solution, and it provides a starting point for writing your code.

For more information about the ThisDocument class and other features you can use in a document-level project, see Programming Document-Level Customizations.

A VSTO Add-in for Microsoft Office Word consists of an assembly that is loaded by Word. The assembly typically extends Word by customizing the UI and by automating Word. Unlike a document-level customization, which is associated with a specific document, functionality that you implement in an VSTO Add-in is not restricted to any single document.

To create a VSTO Add-in project for Word, use the Word Add-in project templates in the New Project dialog box of Visual Studio. For more information, see How to: Create Office Projects in Visual Studio.

For general information about how VSTO Add-ins work, see Architecture of VSTO Add-ins.

Word Add-in Programming Model

When you create a Word VSTO Add-in project, Visual Studio generates a class, called ThisAddIn, which is the foundation of your solution. This class provides a starting point for writing your code, and it also exposes the object model of Word to your VSTO Add-in.

For more information about the ThisAddIn class and other features you can use in an VSTO Add-in, see Programming VSTO Add-Ins.

There are several different ways to customize the user interface of Word. Some options are available to all project types, and other options are available only to VSTO Add-ins or document-level customizations.

Options for All Project Types

The following table lists customization options that are available to both document-level customizations and VSTO Add-ins.

TaskFor more information
Customize the Ribbon. Ribbon Overview
Add Windows Forms controls or extended Word controls to the customized document (for a document-level customization) or to any open document (for a VSTO Add-in). How to: Add Windows Forms Controls to Office Documents

  How to: Add Content Controls to Word Documents

  How to: Add Bookmark Controls to Word Documents

Options for Document-Level Customizations

The following table lists customization options that are available only to document-level customizations.

TaskFor more information
Add an actions pane to the document. Actions Pane Overview

  How to: Add an Actions Pane to Word Documents or Excel Workbooks
Add extended XMLNode and XMLNodes controls to the document surface. How to: Add XMLNode Controls to Word Documents

  How to: Add XMLNodes Controls to Word Documents

Options for VSTO Add-ins

The following table lists customization options that are available only to VSTO Add-ins.

TaskFor more information
Create a custom task pane. Custom Task Panes

Related Topics

TitleDescription
Word Object Model OverviewProvides an overview of the main types provided by the Word object model.
Automating Word by Using Extended ObjectsProvides information about extended objects (provided by the Visual Studio Tools for Office runtime) that you can use in Word solutions.
Windows Forms Controls on Office Documents OverviewDescribes how you can add Windows Forms controls to Word documents.
Walkthrough: Creating Your First Document-Level Customization For WordDemonstrates how to create a basic document-level customization for Word.
Walkthrough: Creating Your First VSTO Add-in for WordDemonstrates how to create a basic VSTO Add-in for Word.
Walkthrough: Adding Controls to a Document at Run Time in a VSTO Add-InDemonstrates how to add a Windows Forms button and a RichTextContentControl to a document at run time by using a VSTO Add-in.
Word 2010 in Office DevelopmentProvides links to articles and reference documentation about developing Word solutions (not specific to Office development using Visual Studio).