DocumentEvents2_XMLBeforeDeleteEventHandler Delegate
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
A Delegate type used to add an event handler for the XMLBeforeDelete event. The XMLBeforeDelete event occurs when a user deletes an XML element from a document.
public delegate void DocumentEvents2_XMLBeforeDeleteEventHandler(Range ^ DeletedRange, XMLNode ^ OldXMLNode, bool InUndoRedo);
[System.Runtime.InteropServices.ComVisible(false)]
public delegate void DocumentEvents2_XMLBeforeDeleteEventHandler(Range DeletedRange, XMLNode OldXMLNode, bool InUndoRedo);
type DocumentEvents2_XMLBeforeDeleteEventHandler = delegate of Range * XMLNode * bool -> unit
Public Delegate Sub DocumentEvents2_XMLBeforeDeleteEventHandler(DeletedRange As Range, OldXMLNode As XMLNode, InUndoRedo As Boolean)
Parameters
- DeletedRange
- Range
Range object. The contents of the XML element being deleted. If only an element is deleted and not associated text, the DeletedRange
parameter will not exist and will, therefore, be set to Nothing.
- InUndoRedo
- Boolean
Boolean. True indicates the action was performed using the Undo or Redo feature in Microsoft Word.
- Attributes
Remarks
If the InUndoRedo
parameter is True, never change the XML in a document while the XMLAfterInsert and XMLBeforeDelete events are running.
If the InUndoRedo
parameter is False, you can insert and delete the XML in the document— but be careful that the XMLAfterInsert and XMLBeforeDelete events will not try to cancel each other out, causing an infinite loop. You can prevent infinite loops by using a global Boolean variable and check for that at the beginning of the error handler.