The Deactivate event handler enables you to take action when the document becomes deactivated. For example, you might want to save the document when the solution becomes deactivated, as Listing 6.39 demonstrates.

Listing 6.39. Saving a document whenever it becomes deactivated

Private Sub ThisDocument_Deactivate(ByVal sender As Object, _ ByVal e As Microsoft.Office.Tools.Word.WindowEventArgs) _ Handles Me.Deactivate

If Me.Saved = False Then

End Sub

0 0

Post a comment