Share via


TaskPanes.Count property

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

Namespace:  Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly:  Microsoft.Office.Interop.InfoPath.SemiTrust (in Microsoft.Office.Interop.InfoPath.SemiTrust.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

Important

This member can be accessed without restrictions.

Examples

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.SemiTrust namespace