How to: Add an Actions Pane to Word Documents
The information in this topic applies only to the specified Visual Studio Tools for Office projects and versions of Microsoft Office.
Microsoft Office version
For more information, see Features Available by Application and Project Type.
The Add New Item dialog box contains an actions pane control that is a user control for the actions pane; you can use an actions pane control or a user control with equal results.
For information about how to add an actions pane to a Microsoft Office Excel workbook, see How to: Add an Actions Pane to Excel Workbooks.
You can create an actions pane only in a document-level customization for Word or Excel. You cannot create an actions pane in an application-level add-in. For more information, see Features Available by Application and Project Type.
Your computer might show different names or locations for some of the Visual Studio user interface elements in the following instructions. The Visual Studio edition that you have and the settings that you use determine these elements. For more information, see Visual Studio Settings.
To create an actions pane control and insert text in the document
Open your Word document or template project in Visual Studio.
On the Project menu, click Add New Item.
In the Add New Item dialog box, select Actions Pane Control, name it HelloControl, and click Add.
If the actions pane control is not visible in the designer, double-click HelloControl in the designer.
From the Windows Forms tab of the Toolbox, drag a Button control onto the actions pane control.
Add the following code to the Click event handler of the button.
In C#, you must add an event handler for the button click. You can place this code in the HelloControl constructor after the call to IntializeComponent.
For information about how to create event handlers, see How to: Create Event Handlers in Visual Studio Tools for Office.
To show the actions pane, add a control to it. The following example adds an actions pane control to the actions pane in Word.