This documentation is archived and is not being maintained.

ErrorsCollection Interface (Microsoft.Office.Interop.InfoPath.SemiTrust)

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

 

Namespace: Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly: Microsoft.Office.Interop.InfoPath.SemiTrust (in microsoft.office.interop.infopath.semitrust.dll)

[CLSCompliantAttribute(false)] 
public interface ErrorsCollection : Errors

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, see Errors.

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.

NoteNote:

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

//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;
Show: