|Important||This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer|
Errors.Add Method (Microsoft.Office.Interop.InfoPath)
Assembly: Microsoft.Office.Interop.InfoPath (in microsoft.office.interop.infopath.dll)
ErrorObject Add ( [InAttribute] Object varNode, [InAttribute] string bstrConditionName, [InAttribute] string bstrShortErrorMessage, [OptionalAttribute] [InAttribute] string bstrDetailedErrorMessage, [OptionalAttribute] [InAttribute] int lErrorCode, [OptionalAttribute] [InAttribute] string bstrType )
The XML node that the error will be associated with.
The name of the error.
The short message for the error.
The detailed message for the error.
The error code of the error.
Default value is "modeless". The type of error processing. The other supported value is "modal".
Return ValueAn ErrorObject object which represents the newly created Error.
The Add method is used to create custom error messages in a Microsoft Office InfoPath 2007 form. There are two types of errors that can be created using the Add method:
The user is notified of the error with an inline alert and can choose to return to the previous value with an undo operation
The user is notified of the error with a dialog box alert. After clicking OK in the dialog box alert, the error will appear as an inline alert and the user can choose to return to the previous value with an undo operation
Custom errors can also be created using the ReportError method.