TaskPaneCollection Class (Microsoft.Office.InfoPath)
Assembly: Microsoft.Office.InfoPath (in microsoft.office.infopath.dll)
The TaskPaneCollection class can be used only to get the count of the 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.
The following example sets a reference to the TaskPane object in the TaskPaneCollection with the index value of 3, which corresponds to the Clip Art task pane, and then displays the task pane.
Alternatively, you can reference a TaskPane object in the TaskPaneCollection by using a TaskPaneType value, as shown in the following example.