Zdarzenie DocumentBase.Open

Występuje, gdy dokument jest otwarty.

Przestrzeń nazw:  Microsoft.Office.Tools.Word
Zestaw:  Microsoft.Office.Tools.Word.v4.0.Utilities (w Microsoft.Office.Tools.Word.v4.0.Utilities.dll)

Składnia

'Deklaracja
Public Event Open As DocumentEvents2_OpenEventHandler
public event DocumentEvents2_OpenEventHandler Open

Przykłady

Poniższy kod wyświetla komunikat po otwarciu dokumentu.Aby wykorzystać ten przykład, należy uruchomić go z klasy ThisDocument w projekcie na poziomie dokumentu.

Private Sub DocumentOpen()
    AddHandler Me.Open, AddressOf ThisDocument_Open
End Sub

Private Sub ThisDocument_Open()
    MessageBox.Show("The document has opened.")
End Sub
private void DocumentOpen()
{
    this.Open += new Microsoft.Office.Interop.Word.DocumentEvents2_OpenEventHandler(ThisDocument_Open);
}

void ThisDocument_Open()
{
    MessageBox.Show("The document has opened.");
}

Zabezpieczenia programu .NET Framework

Zobacz też

Informacje

DocumentBase Klasa

Przestrzeń nazw Microsoft.Office.Tools.Word