Share via


Errors.Delete Method

Deletes the specified ErrorObject object from the ErrorsCollection collection.

Namespace:  Microsoft.Office.Interop.InfoPath
Assembly:  Microsoft.Office.Interop.InfoPath (in Microsoft.Office.Interop.InfoPath.dll)

Syntax

'Declaration
Sub Delete ( _
    varNode As Object, _
    bstrConditionName As String _
)
'Usage
Dim instance As Errors
Dim varNode As Object
Dim bstrConditionName As String

instance.Delete(varNode, bstrConditionName)
void Delete(
    Object varNode,
    string bstrConditionName
)

Parameters

  • varNode
    Type: System.Object

    The XML Document Object Model (DOM) node associated with the error.

Remarks

The Delete method deletes all the Error objects in the Errors collection that are associated with the specified XML node and that have the same name. To delete all of the Error objects contained in the Errors collection, use the DeleteAll method.

Note

The Delete method will only delete errors that were created using the Add method. It cannot be used to delete errors that occur because of schema or data validation constraints, or errors that were created using the ReportError method.

Examples

//Delete the errors associated with a specific node
IXMLDOMDocument myDOM = thisXDocument.DOM;
IXMLDOMNode myNode = myDOM.selectSingleNode("my:myFields/my:aGroup/my:field1");
thisXDocument.Errors.Delete(myNode,thisXDocument.Errors[0].ConditionName.ToString());

See Also

Reference

Errors Interface

Errors Members

Microsoft.Office.Interop.InfoPath Namespace