Share via


ViewInfos.Count property

Gets a count of the number of ViewInfoObject object contained in the ViewInfosCollection 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 ViewInfos
Dim value As Integer

value = instance.Count
int Count { get; }

Property value

Type: System.Int32

Examples

In the following example, the Count property is used within a for loop to iterate through the collection of ViewInfo objects and display a message box indicating the name of each view implemented in the form:

for (int i=0; i < thisXDocument.ViewInfos.Count; i++)
{
 thisXDocument.UI.Alert("View name: " + thisXDocument.ViewInfos[i].Name);
}

See also

Reference

ViewInfos interface

ViewInfos members

Microsoft.Office.Interop.InfoPath namespace