Share via


TaskPanes.Count property

Gets a count of the number of the TaskPaneObject objects contained in the collection.

Namespace:  Microsoft.Office.Interop.InfoPath
Assembly:  Microsoft.Office.Interop.InfoPath (in Microsoft.Office.Interop.InfoPath.dll)

Syntax

'Declaration
ReadOnly Property Count As Integer
    Get
'Usage
Dim instance As TaskPanes
Dim value As Integer

value = instance.Count
int Count { get; }

Property value

Type: System.Int32

Remarks

In the following example, the Count property is used within a for loop to iterate through the collection of TaskPane objects. It checks the Visible property of each TaskPane object and if it is true, sets it to false.

TaskPanes taskPanes;

taskPanes = thisXDocument.View.Window.TaskPanes;

for (int i=0; i < taskPanes.Count; i++)   
{
 if (taskPanes[i].Visible == true)
 {
  taskPanes[i].Visible = false;
 }
}

See also

Reference

TaskPanes interface

TaskPanes members

Microsoft.Office.Interop.InfoPath namespace