ContextChangeEventArgs Interface
Provides data for the Select, Deselect, ContextEnter and ContextLeave events of an XMLNode object and the ContextEnter, ContextLeave, Select, and Deselect events of an XMLNodes object.
Assembly: Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)
| Name | Description | |
|---|---|---|
![]() | NewXMLNode | Gets the XMLNode control to which the selection has moved. |
![]() | OldXMLNode | Gets the XMLNode control from which the selection has moved. |
![]() | Reason | Gets the reason why the selection has changed. |
![]() | Selection | Gets the selected text, including the XML elements. |
The following code example demonstrates event handlers for the XMLNode::Select, XMLNode::Deselect, XMLNode::ContextEnter, and XMLNode::ContextLeave events. When the XMLNode::Select and XMLNode::Deselect events are raised, the event handlers add double lines to the borders of the selection or remove the double lines, depending on the event. When the XMLNode::ContextEnter and XMLNode::ContextLeave events are raised, the event handlers display messages that state the names of the newly selected node and the previously selected node. This example assumes that the current document contains an XMLNode named CustomerNode.
