Microsoft Office Tutorials and References
In Depth Information
Creating an InfoPath Task Pane
7. Add a global variable for your Task Pane immediately after the partial
class declaration:
private CustomTaskPane CustomTaskPane;
8. Add a Click event for the button in the toolbar to open the Task Pane. You
have to write the following code to call your Task Pane in this event handler.
private void openTaskPane_Click(Office._CommandBarButton src,
ref bool Cancel)
{
// Task Pane Class initiation
CustomTaskPane = new CustomTaskPane();
// Adding the Task Pane
CustomTaskPanes.Add(CustomTaskPane, "Task Pane");
// Make the Task Pane to be visible for the users
CustomTaskPanes[0].Visible = true;
}
9. Here is the code to append the custom button for our Task Pane into
Microsoft InfoPath 2007. When the user clicks on this button, the Task
Pane will be visible to the user.
private void ThisAddIn_Startup(object sender,
System.EventArgs e)
{
// Code to append the custom button we created to the
standard toolbar
if (this.Application.ActiveWindow != null)
{
Office.CommandBars AddInCommandBars = (Office.
CommandBars)this.Application.ActiveWindow.CommandBars;
Office.CommandBar AddInStandardBar =
AddInCommandBars["Standard"];
 
Search JabSto ::




Custom Search