The Select event handler enables you to take action when the user selects an area within an XMLNode. The Select event differs from the ContextEnter event in that Select is raised only for the XMLNode that is selected, and not for the parent XMLNode. Listing 6.33 displays the XMLNodes in the document when the XMLNode is selected.

Listing 6.33. Showing the XMLNode markup in the document when text in an XMLNode control is selected

Private Sub NameFirstNameNode_Select(ByVal sender As _ Object, ByVal e As Microsoft.Office.Tools.Word _ .ContextChangeEventArgs) Handles _ NameFirstNameNode.Select

Me.ActiveWindow.View.ShowXMLMarkup = True End Sub

0 0

Post a comment