مشاركة عبر


Document.SelectionChange الحدث

يحدث عند تغير تحديد في نافذة مستند.

مساحة الاسم:  Microsoft.Office.Tools.Word
التجميع:  Microsoft.Office.Tools.Word (في Microsoft.Office.Tools.Word.dll)

بناء الجملة

'إقرار
Event SelectionChange As SelectionEventHandler
event SelectionEventHandler SelectionChange

أمثلة

يلي تعليمات برمجية المثال يعرض رسالة تشير إلى أنه تم تم تغييره تحديد عند تم تغييره تحديد داخل مستند. Th هو المثال هو للوظيفة الإضافية المستوى تطبيق.

Private Sub DocumentSelectionChange()
    Dim vstoDoc As Document = Globals.Factory.GetVstoObject(Me.Application.ActiveDocument)
    AddHandler vstoDoc.SelectionChange, AddressOf ThisDocument_SelectionChange
End Sub

Private Sub ThisDocument_SelectionChange(ByVal sender As Object, ByVal e As Microsoft.Office. _
    Tools.Word.SelectionEventArgs)
    System.Windows.Forms.MessageBox.Show("The selection in the document has changed.")
End Sub
private void DocumentSelectionChange()
{
    Document vstoDoc = Globals.Factory.GetVstoObject(this.Application.ActiveDocument);
    vstoDoc.SelectionChange += new Microsoft.Office.Tools.Word.SelectionEventHandler(ThisDocument_SelectionChange);
}

void ThisDocument_SelectionChange(object sender, Microsoft.Office.Tools.Word.SelectionEventArgs e)
{
    System.Windows.Forms.MessageBox.Show("The selection in the document has changed.");
}

أمن NET Framework.

راجع أيضًَا

المرجع

Document واجهة

Document الأعضاء

Microsoft.Office.Tools.Word مساحة الاسم