Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2008
Visual Studio
 Task Pane Demo Sample

  Switch on low bandwidth view
Microsoft Visual Studio Tools for the Microsoft Office system (version 3.0)
Task Pane Demo Sample

NoteNote:

This sample runs only in Microsoft Office Word 2007.

This sample demonstrates how to create a custom task pane for Microsoft Office Word. The task pane contains a text box and a button. When the user types in the text box and clicks the button, the string in the text box is added to the beginning of the active document.

This sample automatically displays the task pane when the add-in loads. However, this sample does not provide a way for the user to display or hide the task pane. Typically, your add-in should provide a UI element, such as a button on the Ribbon, that users can click to display or hide your task pane. For a walkthrough that demonstrates how to do this, see Walkthrough: Synchronizing a Custom Task Pane with a Ribbon Button.

To create the custom task pane, this sample uses the CustomTaskPane and CustomTaskPaneCollection classes provided by Visual Studio Tools for Office. For more information about using these classes to create custom task panes, see Custom Task Panes Overview.

Security noteSecurity Note:

This sample code is intended to illustrate a concept, and it shows only the code that is relevant to that concept. It may not meet the security requirements for a specific environment, and it should not be used exactly as shown. We recommend that you add security and error-handling code to make your projects more secure and robust. Microsoft provides this sample code "AS IS" with no warranties.

Download sample

To run this sample

  1. Press F5.

  2. In the Contoso task pane, type some text in the text box.

  3. Click the Insert button.

    Verify that the text that you typed in the text box is inserted at the beginning of the active document.

This sample requires the following applications:

  • Visual Studio Tools for Office.

  • Microsoft Office Word 2007.

This sample demonstrates the following concepts:

  • Creating and displaying a custom task pane in a Word add-in.

  • Inserting text entered in the custom task pane into the active Word document.

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker