DocumentBase.Shutdown Event


Occurs when the document host item shuts down.

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

public event EventHandler Shutdown

This is the last event that is raised when the document host item in your project unloads. Use this event for any additional clean up. The application domain for the assembly unloads when the document host item shuts down.

The following code example adds a new Shutdown event handler that displays a message that shows that the document is shutting down. To use this example, run it from the ThisDocument class in a document-level project.

private void DocumentShutdown()
    this.Shutdown +=new EventHandler(ThisDocument_Shutdown2);


private void ThisDocument_Shutdown2(object sender, System.EventArgs e)
    MessageBox.Show("The Shutdown event was raised.");
Return to top