DocumentBase.Deactivate Event

Occurs when the active document window loses focus.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word.v4.0.Utilities (in Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

public event WindowEventHandler Deactivate

The Deactivate event does not occur when you unload the document.

The following code example displays a message when the document is deactivated. To use this example, run it from the ThisDocument class in a document-level project.

private void DocumentDeactivate()
{
    this.Deactivate += new Microsoft.Office.Tools.Word.WindowEventHandler(ThisDocument_Deactivate);
}

void ThisDocument_Deactivate(object sender, Microsoft.Office.Tools.Word.WindowEventArgs e)
{
    MessageBox.Show ("The document has been deactivated");
}

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft