Share via


Errors.Count Property

Gets a count of the number of ErrorObject 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 Errors
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 to iterate through the collection of Error objects and display a message box indicating the short error message of each error:

for (int i=0; i < thisXDocument.Errors.Count; i++)
{
 thisXDocument.UI.Alert("Error message: " + thisXDocument.Errors[i].ShortErrorMessage);
}

See Also

Reference

Errors Interface

Errors Members

Microsoft.Office.Interop.InfoPath Namespace