FormErrorCollection.Delete Method (String) (Microsoft.Office.InfoPath)
Deletes all FormError objects of the specified name from the FormErrorCollection object associated with the current form.
Namespace: Microsoft.Office.InfoPath
Assembly: Microsoft.Office.InfoPath (in microsoft.office.infopath.dll)
Syntax
'Declaration
Public MustOverride Sub Delete ( _
name As String _
)
'Usage
Dim instance As FormErrorCollection
Dim name As String
instance.Delete(name)
public abstract void Delete (
string name
)
Parameters
- name
The name of the FormError to delete.
Exceptions
Exception type | Condition |
---|---|
The error is not of type FormErrorType.UserDefined. |
|
ArgumentException |
The error is not in the collection. |
The parameter passed to this method is null. |
|
ArgumentException |
The parameter passed to this method isnot valid. For example, it is of the wrong type or format. |
Remarks
All errors of the specified name will be deleted from the collection (errors associated with different context nodes in the form can have the same name). Only errors of type ErrorType.UserDefined can be deleted from the collection. If the specified error is not user-defined, or is not in the collection, an exception is thrown.
This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.
This type or member can be accessed from code running in forms opened in Microsoft Office InfoPath 2007 or in a Web browser.
Example
In the following example, the Delete(name) method is used to delete the error name Field1Error from the FormErrorCollection object associated with the current form.
this.Errors.Delete("Field1Error");
Me.Errors.Delete("Field1Error")
See Also
Reference
FormErrorCollection Class
FormErrorCollection Members
Microsoft.Office.InfoPath Namespace