ErrorsCollection Interface
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Contains an ErrorObject object for each error within a Microsoft InfoPath form.
public interface class ErrorsCollection : Microsoft::Office::Interop::InfoPath::Errors
[System.Runtime.InteropServices.Guid("096CD578-0786-11D1-95FA-0080C78EE3BB")]
public interface ErrorsCollection : Microsoft.Office.Interop.InfoPath.Errors
type ErrorsCollection = interface
interface Errors
Public Interface ErrorsCollection
Implements Errors
- Derived
- Attributes
- Implements
Examples
//Add an error to the node
IXMLDOMDocument myDOM = thisXDocument.DOM;
IXMLDOMNode myNode = myDOM.selectSingleNode("my:myFields/my:aGroup/my:field1");
thisXDocument.<span class="label">Errors</span>.Add(myNode,"condition","short","detail",102057,"modeless");
<p>The <strong>Errors</strong> collection is accessed through the <xref data-throw-if-not-resolved="true" uid="Microsoft.Office.Interop.InfoPath._XDocument2.Errors"></xref> property of the <xref data-throw-if-not-resolved="true" uid="Microsoft.Office.Interop.InfoPath.XDocument"></xref> object.</p>
<code><span class="label">ErrorsCollection</span> err = thisXDocument.Errors;</code>
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(Object, String, String, String, Int32, String) method.
Note: Custom errors can also be created using the ReportError(Object, String, Boolean, String, Int32, String) method of the DataDOMEventObject object.
Properties
Count |
Gets a count of the number of ErrorObject objects contained in the collection. (Inherited from Errors) |
Item[Int32] |
Gets a reference to the specified ErrorObject object from the collection. (Inherited from Errors) |
Methods
Add(Object, String, String, String, Int32, String) |
Adds an ErrorObject to ErrorsCollection and returns a reference to the new Error object. (Inherited from Errors) |
Delete(Object, String) |
Deletes the specified ErrorObject object from the ErrorsCollection collection. (Inherited from Errors) |
DeleteAll() |
Deletes all of the ErrorObject objects contained in the ErrorsCollection collection. (Inherited from Errors) |
GetEnumerator() |
Gets an IEnumerator that iterates over all entries in the ErrorsCollection object. (Inherited from Errors) |