Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

DocumentEvents2_XMLAfterInsertEventHandler Delegate 

A Delegate type used to add an event handler for the XMLAfterInsert event. The XMLAfterInsert event occurs when a user adds a new XML element to a document.

Namespace: Microsoft.Office.Interop.Word
Assembly: Microsoft.Office.Interop.Word (in microsoft.office.interop.word.dll)

'Usage
Sub Sub1(NewXMLNode As XMLNode, _
	InUndoRedo As Boolean)
End Sub
Dim documentEvents2_XMLAfterInsertEventHandler1 As New DocumentEvents2_XMLAfterInsertEventHandler(AddressOf Sub1)

public delegate void DocumentEvents2_XMLAfterInsertEventHandler(
	[In] XMLNode NewXMLNode, 
	[In] bool InUndoRedo
);
public delegate void DocumentEvents2_XMLAfterInsertEventHandler(
	/*in*/XMLNode NewXMLNode, 
	/*in*/boolean InUndoRedo
);
In JScript, you can use the delegates in the .NET Framework, but you cannot define your own.

Parameters

NewXMLNode

XMLNode. The newly added XML node.

InUndoRedo

Boolean. True indicates the action was performed using the Undo or Redo feature in Microsoft Word.

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.


Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, and Windows 2000

Target Platforms

Community Additions

Show:
© 2014 Microsoft