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
'Usage

Parameters

  • varNode
    The XML Document Object Model (DOM) node associated with the error.
  • bstrConditionName
    The name of 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.

Example

//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