TaskPanes Collection

Microsoft Office InfoPath

Show All Show All

TaskPanes Collection

TaskPanes TaskPane

Contains a collection of TaskPane objects that represent the task panes associated with a window in Microsoft Office InfoPath 2003.

Remarks

The TaskPanes collection provides properties that can be used to access a collection of task pane objects, and it is accessed through the TaskPanes property of the Window object.

Note  The TaskPanes collection can be used only to get the count of TaskPane objects that it contains and to return a reference to a specified TaskPane object. It cannot be used to add or remove TaskPane objects.

Using the TaskPanes collection

In the following example, the TaskPanes property of the Window object is used to set a reference to the TaskPanes collection:

    var objTaskPanes;

objTaskPanes = XDocument.View.Window.TaskPanes;
  

In the following example, the Item property of the TaskPanes collection is used to set a reference to a specified TaskPane object. Then the code uses the Visible property of the TaskPane object to make the task pane visible.

    var objTaskPane;

// Show the built-in Help task pane.
objTaskPane = XDocument.View.Window.TaskPanes(4);
objTaskPane.Visible = true;
  

Note  The Item property argument is the type of task pane to return, based on the Type property of the TaskPane object, not the position of the TaskPane object in the TaskPanes collection.