Compartir a través de


DocumentBase.CloseEvent (Evento)

Se produce cuando el documento está cerrado.

Espacio de nombres:  Microsoft.Office.Tools.Word
Ensamblado:  Microsoft.Office.Tools.Word.v4.0.Utilities (en Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

Sintaxis

'Declaración
Public Event CloseEvent As DocumentEvents2_CloseEventHandler
public event DocumentEvents2_CloseEventHandler CloseEvent

Ejemplos

En el ejemplo de código siguiente se muestra un mensaje cuando se cierra el documento.Para usar este ejemplo, ejecútelo desde la clase ThisDocument en un proyecto de nivel de documento.

Private Sub DocumentCloseEvent()
    AddHandler Me.CloseEvent, AddressOf ThisDocument_CloseEvent
End Sub
Sub ThisDocument_CloseEvent()
    MessageBox.Show("The document is closing.")
End Sub
private void DocumentCloseEvent()
{
    this.CloseEvent += new Microsoft.Office.Interop.Word.DocumentEvents2_CloseEventHandler(ThisDocument_CloseEvent);
}

void ThisDocument_CloseEvent()
{
    MessageBox.Show("The document is closing.");
}

Seguridad de .NET Framework

Vea también

Referencia

DocumentBase Clase

Microsoft.Office.Tools.Word (Espacio de nombres)