ErrorsCollection Interface
Contains an ErrorObject object for each error within a Microsoft InfoPath 2010 form.
Namespace: Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly: Microsoft.Office.Interop.InfoPath.SemiTrust (in Microsoft.Office.Interop.InfoPath.SemiTrust.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 coclass that is required by managed code for COM interoperability. Use this type to access the members of the COM interface implemented by this coclass. For information about the COM interface, including a link to descriptions of its members, 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;