DocumentBase.Open Olay
Belge açıldığında oluşur.
Ad alanı: Microsoft.Office.Tools.Word
Derleme: Microsoft.Office.Tools.Word.v4.0.Utilities (Microsoft.Office.Tools.Word.v4.0.Utilities.dll içinde)
Sözdizimi
'Bildirim
Public Event Open As DocumentEvents2_OpenEventHandler
public event DocumentEvents2_OpenEventHandler Open
Örnekler
Aşağıdaki kod örneğinde, belge açıldığında bir ileti görüntüler.Bu örneği kullanmak için çalıştırın ThisDocument bir belge düzeyi projesinde sınıf.
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.");
}
.NET Framework Güvenliği
- Anında arayanlar için tam güven. Bu üye kısmen güvenilen kodla kullanılamaz. Daha fazla bilgi için bkz. Kısmen güvenilen kod kitaplıklarını kullanma.