Share via


DataObjects.Count Property

InfoPath Developer Reference

A read-only property that returns a count of the number of DataObject objects contained in the DataObjects collection. Read-only

Version Information
 Version Added:  InfoPath 2003

Syntax

expression.Count

expression   An expression that returns a DataObjects object.

Return Value
Long

Remarks

The Count property returns a long integer value.

Security Level 0: Can be accessed without restrictions.

Example

In the following example, the Count property is used within a Microsoft JScript for loop to iterate through the collection of DataObject objects and display a message box indicating the name of each DataObject object associated with the form:

JScript
  for (i=0; i < XDocument.DataObjects.Count; i++)
{
   XDocument.UI.Alert("DataObject name: " + XDocument.DataObjects(i).Name);
}

See Also