Export (0) Print
Expand All

Word Host Controls

Updated: July 2008

Applies to

The information in this topic applies only to the specified Visual Studio Tools for Office projects and versions of Microsoft Office.

Document-level projects

  • Word 2003

  • Word 2007

Application-level projects

  • Word 2007

For more information, see Features Available by Application and Project Type.

Visual Studio Tools for Office provides controls, named host controls, that extend the functionality of some important objects in Microsoft Office Word so that they expose events and can be bound to data. In document-level projects, you can add any host control to your document at design time, or you can add content controls and bookmark controls at run time. Starting in Visual Studio 2008 Service Pack 1 (SP1), you can add content controls and bookmark controls to any open document at run time in application-level add-ins for Word 2007.

Content Controls

Describes the extended functionality of content controls, including the different types of content controls and the addition of events and data binding. Also describes how to use content controls to prevent users from editing or deleting sections of documents.

Bookmark Control

Describes the extended functionality of Bookmark controls, including the addition of events and data binding. Also describes the behavior of overlapping controls and text assignment.

XMLNode Control

Describes the extended functionality of XMLNode controls, including the addition of events and data binding.

XMLNodes Control

Provides information about the XMLNodes controls collection, including reasons why data binding is not supported by this control.

How to: Add Content Controls to Word Documents

Demonstrates how to add content controls to a document at design time and programmatically at run time.

How to: Add Bookmark Controls to Word Documents

Demonstrates how to add Bookmark controls to a document at design time and programmatically at run time.

How to: Add XMLNode Controls to Word Documents

Describes how to map non-repeating XML elements to a document to create an XMLNode control on the document.

How to: Add XMLNodes Controls to Word Documents

Describes how to map repeating XML elements to a document to create an XMLNodes control on the document.

How to: Resize Bookmark Controls

Demonstrates the various ways to resize Bookmark controls, including adding text to the bookmark, recreating the bookmark, and setting the start and end properties in the Properties window.

Walkthrough: Creating a Template By Using Content Controls

Demonstrates how to use all the available content controls to create two interactive tables that users can add to documents.

Walkthrough: Binding Content Controls to Custom XML Parts

Demonstrates how to bind several different types of content controls to data that is stored in custom XML parts in the document.

Walkthrough: Creating Shortcut Menus for Bookmarks

Demonstrates how to write code in the BeforeRightClick event handler of a Bookmark control to display a shortcut menu when the user right-clicks text within a bookmark.

Host Items and Host Controls Overview

Describes the relationship between host items and host controls, and the additional functionality that has been added to the native Office objects upon which they are based.

Excel Host Controls

Provides links to information about the host controls available in document-level projects for Microsoft Office Excel.

Binding Data to Controls in Office Solutions

Lists topics that show how to bind controls, including host controls, to data.

Date

History

Reason

July 2008

Added information about using host controls in application-level add-ins.

SP1 feature change.

Community Additions

ADD
Show:
© 2014 Microsoft