ErrorsCollection interface

Contains an ErrorObject object for each error within a Microsoft InfoPath form.

Namespace:  Microsoft.Office.Interop.InfoPath
Assembly:  Microsoft.Office.Interop.InfoPath (in Microsoft.Office.Interop.InfoPath.dll)

Syntax

'Declaration
<GuidAttribute("096CD578-0786-11D1-95FA-0080C78EE3BB")> _
Public Interface ErrorsCollection _
    Inherits Errors
'Usage
Dim instance As ErrorsCollection
[GuidAttribute("096CD578-0786-11D1-95FA-0080C78EE3BB")]
public interface ErrorsCollection : Errors

Remarks

This type is a wrapper for a COM interface implemented by a coclass that is required by managed code for COM interoperability. To access the members specified by this interface, use the type that wraps the coclass that implements this interface. For information about that type, including usage, remarks, and examples, seeErrors.

The Errors collection provides properties and methods for adding, deleting, and gaining access to the Error objects that it contains.

In addition to managing the errors generated by InfoPath, the Errors collection can also be used to create custom errors using the Add method.

Note

Custom errors can also be created using the ReportError method of the DataDOMEventObject object.

Examples

//Add an error to the node
IXMLDOMDocument myDOM = thisXDocument.DOM;
IXMLDOMNode myNode = myDOM.selectSingleNode("my:myFields/my:aGroup/my:field1");
thisXDocument.Errors.Add(myNode,"condition","short","detail",102057,"modeless");

The Errors collection is accessed through the Errors property of the XDocument object.

ErrorsCollection err = thisXDocument.Errors;

See also

Reference

ErrorsCollection members

Microsoft.Office.Interop.InfoPath namespace