Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

ErrorObject Interface (Microsoft.Office.Interop.InfoPath)

Represents an error in a Microsoft Office InfoPath 2007 form.

Namespace: Microsoft.Office.Interop.InfoPath
Assembly: Microsoft.Office.Interop.InfoPath (in microsoft.office.interop.infopath.dll)
public interface ErrorObject : Error

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 Error.

Each Error object in InfoPath is each associated with an XML Document Object Model (DOM) node from a form's underlying XML document. When data validation fails for a particular XML DOM node, InfoPath creates an Error object and places it in the ErrorsCollection collection.

There are three types of data validation errors that can occur in an InfoPath form:

  • SCHEMA_VALIDATION Data validation failed as a result of an XML Schema–defined constraint.

  • SYSTEM_GENERATED Data validation failed as a result of constraints defined in the form definition (.xsf) file or as a result of form code calling the ReportError method of DataDOMEventObject object.

  • USER_SPECIFIED Data validation failed as a result of a custom scripting error using the Add method of the Errors collection.

NoteNote:

The ErrorType property can be used to determine the type of data validation error that has occurred.

In the following example, the Error object is accessed using indexing in the Errors collection.

Error er = thisXDocument.Errors[0];
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.