Helper Methods for Host Controls
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
Application-level projects
For more information, see Features Available by Application and Project Type. |
You can programmatically add host controls to a Microsoft Office Word document and Microsoft Office Excel workbook at run time by using helper methods. The helper methods are in the Microsoft.Office.Tools.Excel.ControlCollection and Microsoft.Office.Tools.Word.ControlCollection classes.
For more information, see Adding Controls to Office Documents at Run Time.
Helper Methods for Excel
The following table lists the helper methods that you can use to programmatically add host controls to Excel workbooks.
Helper method |
Description |
---|---|
Adds a Chart control to the specified range. |
|
Adds a Chart control at the specified position, instead of in a range. The coordinates are represented in points. |
|
Adds a ListObject control to the specified range. |
|
Adds a ListObject control that is based on a native list object in the workbook. This method is new in Visual Studio 2008 Service Pack 1 (SP1). |
|
Adds a NamedRange control to the specified range. |
Helper Methods for Word
The following table lists the helper methods that you can use to programmatically add host controls to Word documents.
Helper Method |
Definition |
---|---|
Adds a Bookmark control at the specified range. |
|
Adds a BuildingBlockGalleryContentControl at the current selection in the document. |
|
AddBuildingBlockGalleryContentControl(ContentControl, String) |
Adds a BuildingBlockGalleryContentControl that is based on a native content control in the document. |
Adds a BuildingBlockGalleryContentControl at the specified range. |
|
Adds a ComboBoxContentControl at the current selection in the document. |
|
Adds a ComboBoxContentControl that is based on a native content control in the document. |
|
Adds a ComboBoxContentControl at the specified range. |
|
Adds a ContentControl of the specified type at the current selection in the document. |
|
Adds a ContentControl that is based on a native content control in the document. |
|
Adds a ContentControl of the specified type at the specified range. |
|
Adds a DatePickerContentControl at the current selection in the document. |
|
Adds a DatePickerContentControl that is based on a native content control in the document. |
|
Adds a DatePickerContentControl at the specified range. |
|
Adds a DropDownListContentControl at the current selection in the document. |
|
Adds a DropDownListContentControl that is based on a native content control in the document. |
|
Adds a DropDownListContentControl at the specified range. |
|
Adds a GroupContentControl at the current selection in the document. |
|
Adds a GroupContentControl that is based on a native content control in the document. |
|
Adds a GroupContentControl at the specified range. |
|
Adds a PictureContentControl at the current selection in the document. |
|
Adds a PictureContentControl that is based on a native content control in the document. |
|
Adds a PictureContentControl at the specified range. |
|
Adds a PlainTextContentControl at the current selection in the document. |
|
Adds a PlainTextContentControl that is based on a native content control in the document. |
|
Adds a PlainTextContentControl at the specified range. |
|
Adds a RichTextContentControl at the current selection in the document. |
|
Adds a RichTextContentControl that is based on a native content control in the document. |
|
Adds a RichTextContentControl at the specified range. |
See Also
Concepts
Adding Controls to Office Documents at Run Time
Host Items and Host Controls Overview
Programmatic Limitations of Host Items and Host Controls
Other Resources
Change History
Date |
History |
Reason |
---|---|---|
July 2008 |
Added new AddListObject(ListObject) overload to list of helper methods for Excel. |
SP1 feature change. |