Document.Deactivate Olay
Etkin belge penceresi odağı kaybettiğinde oluşur.
Ad alanı: Microsoft.Office.Tools.Word
Derleme: Microsoft.Office.Tools.Word (Microsoft.Office.Tools.Word.dll içinde)
Sözdizimi
'Bildirim
Event Deactivate As WindowEventHandler
event WindowEventHandler Deactivate
Açıklamalar
Deactivate Olay ortaya olduğunda bellekten belge.
Örnekler
Aşağıdaki kod örneği, belge devre dışı bırakıldığında bir ileti görüntüler. Bu bir uygulama düzeyinde eklentisi örneğidir.
Private Sub DocumentDeactivate()
Dim vstoDoc As Document = Globals.Factory.GetVstoObject(Me.Application.ActiveDocument)
AddHandler vstoDoc.Deactivate, AddressOf ThisDocument_Deactivate
End Sub
Private Sub ThisDocument_Deactivate(ByVal sender As Object, ByVal e As Microsoft.Office.Tools.Word.WindowEventArgs)
System.Windows.Forms.MessageBox.Show("The document has been deactivated")
End Sub
private void DocumentDeactivate()
{
Document vstoDoc = Globals.Factory.GetVstoObject(this.Application.ActiveDocument);
vstoDoc.Deactivate += new Microsoft.Office.Tools.Word.WindowEventHandler(ThisDocument_Deactivate);
}
void ThisDocument_Deactivate(object sender, Microsoft.Office.Tools.Word.WindowEventArgs e)
{
System.Windows.Forms.MessageBox.Show ("The document has been deactivated");
}
.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üvenilir kod tarafından Kitaplıklar kullanma.