Aracılığıyla paylaş


Bookmark.Selected Olay

Oluşur, Bookmark denetimin seçili.

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

Sözdizimi

'Bildirim
Event Selected As SelectionEventHandler
event SelectionEventHandler Selected

Notlar

Bu olay için Seçim değiştiğinde harekete geçirilen Bookmark denetim.

Örnekler

Aşağıdaki kod örneğinde bir Bookmark sonra oluşturur ve denetleme belgesine metinle birlikte bir Selected olay işleyicisi.Yer işaretine İmleci hareket ettiğinde, bir ileti kutusu görüntülenir.

Bu örnek için belge düzeyi özelleştirmesinde içindir.

WithEvents Bookmark4 As Microsoft.Office.Tools.Word.Bookmark

Private Sub BookmarkSelected()
    Me.Paragraphs(1).Range.InsertParagraphBefore()
    Bookmark4 = Me.Controls.AddBookmark(Me.Paragraphs(1).Range, _
        "Bookmark4")
    Bookmark4.Text = "This is a sample bookmark."
End Sub

Private Sub Bookmark4_Selected(ByVal sender As Object, _
    ByVal e As Microsoft.Office.Tools.Word.SelectionEventArgs) _
    Handles Bookmark4.Selected
    MessageBox.Show("The selection has moved to Bookmark1.")
End Sub
Microsoft.Office.Tools.Word.Bookmark bookmark4;

private void BookmarkSelected()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();
    bookmark4 = this.Controls.AddBookmark(this.Paragraphs[1]
        .Range, "bookmark4");
    bookmark4.Text = "This is a sample bookmark.";
    bookmark4.Selected += new Microsoft.Office.Tools
        .Word.SelectionEventHandler(bookmark4_Selected);
}

void bookmark4_Selected(object sender, Microsoft.Office.Tools
    .Word.SelectionEventArgs e)
{
    MessageBox.Show("The selection has moved to bookmark1.");
}

.NET Framework Güvenliği

Ayrıca bkz.

Başvuru

Bookmark Arabirim

Microsoft.Office.Tools.Word Ad Alanı