Count Property (ViewInfos Collection)

Microsoft Office InfoPath

A read-only property that returns a count of the number of ViewInfo objects contained in the ViewInfos collection.

expression.Count

expression    Required. An expression that returns a reference to the ViewInfos collection.

Security Level

0: Can be accessed without restrictions.

Remarks

The Count property returns a long integer value.

Example

In the following example, the Count property is used within a Microsoft JScript 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 (i=0; i < XDocument.ViewInfos.Count; i++)
{
   XDocument.UI.Alert("View name: " + XDocument.ViewInfos(i).Name);
}