XMLBefore Delete

The XMLBeforeDelete event handler enables you to take action when an XML element is deleted from the document. For example, you might want to warn the user that an XML element has been deleted. Listing 6.40 demonstrates.

Listing 6.40. Warning users that an XML element has been deleted from a document

Private Sub NameFirstNameNode_ValidationError(ByVal sender _ As Object, ByVal e As System.EventArgs) Handles _ NameFirstNameNode.ValidationError

Dim invalidXML As Microsoft.Office.Tools.Word.XMLNode _ = CType(sender, Microsoft.Office.Tools.Word.XMLNode)

MsgBox(invalidXML.ValidationErrorText.ToString())

End Sub

0 0

Post a comment