Aracılığıyla paylaş


Document.ActivateEvent Olay

Belgeyi etkin pencere olduğunda oluşur.

Ad alanı:  Microsoft.Office.Tools.Word
Derleme:  Microsoft.Office.Tools.Word (Microsoft.Office.Tools.Word.dll içinde)

Sözdizimi

'Bildirim
Event ActivateEvent As WindowEventHandler
event WindowEventHandler ActivateEvent

Notlar

ActivateEvent Olayı, odak uygulama içinde hareket ettirdiğinizde yalnızca oluşur.Veya başka bir uygulamada bir nesneden odağı taşıyarak olayını tetiklemez.

Örnekler

Aşağıdaki kod parçacığını belge etkinleştirildiğinde, bir ileti görüntüler.Bu örnek, bir uygulama düzeyi eklentisinde içindir.

Private Sub DocumentActivateEvent()
    Dim vstoDoc As Document = Globals.Factory.GetVstoObject(Me.Application.ActiveDocument)
    AddHandler vstoDoc.ActivateEvent, AddressOf ThisDocument_ActivateEvent
End Sub

Private Sub ThisDocument_ActivateEvent(ByVal sender As Object, _
    ByVal e As Microsoft.Office.Tools.Word.WindowEventArgs)
    System.Windows.Forms.MessageBox.Show("The document has been activated")
End Sub
private void DocumentActivateEvent()
{
    Document vstoDoc = Globals.Factory.GetVstoObject(this.Application.ActiveDocument);
    vstoDoc.ActivateEvent += new Microsoft.Office.Tools.Word.WindowEventHandler(ThisDocument_ActivateEvent);
}

void ThisDocument_ActivateEvent(object sender, Microsoft.Office.Tools.Word.WindowEventArgs e)
{
    System.Windows.Forms.MessageBox.Show("The document has been activated");
}

.NET Framework Güvenliği

Ayrıca bkz.

Başvuru

Document Arabirim

Microsoft.Office.Tools.Word Ad Alanı