This walkthrough demonstrates how to create an actions pane in a Microsoft Office Word document. The actions pane contains two controls that collect input and then send the text to the document.

This walkthrough illustrates the following tasks:

Designing an interface by using Windows Forms controls on an actions pane control.

Displaying the actions pane when the application opens.

Note:

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.

The actions pane will send text to bookmarks in the document. To design the document, type some text to create a basic form.

To add text to your document

Type the following text into your Word document:

March 21, 2008

Name

Address

This is an example of a basic actions pane in Word.

You can add a Bookmark control to your document by dragging it from the Toolbox in Visual Studio or by using the Bookmark dialog box in Word.

To add a Bookmark control to your document

From the Word Controls tab of the Toolbox, drag a Bookmark control to your document.

The Add Bookmark Control dialog box appears.

Select the word Name, without selecting the paragraph mark, and click OK.

Note:

The paragraph mark should be outside of the bookmark. If paragraph marks are not visible in the document, click the Tools menu, point to Microsoft Office Word Tools and then click Options. Click the View tab, and select the Paragraph marks check box in the Formatting marks section of the Options dialog box.

In the Properties window, change the Name property of Bookmark1 to showName.

Select the word Address, without selecting the paragraph mark.

Perform one of the following steps:

For Word 2003: On the Insert menu, click Bookmark.

For Word 2007: On the Insert tab of the Ribbon, in the Links group, click Bookmark.

In the Bookmark dialog box, type showAddress in the Bookmark Name box and click Add.