Freigeben über


Bookmark.Sentences-Eigenschaft

Ruft eine Sentences-Auflistung ab, die alle Sätze im Bookmark-Steuerelement darstellt.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)

Syntax

'Declaration
ReadOnly Property Sentences As Sentences
Sentences Sentences { get; }

Eigenschaftswert

Typ: Microsoft.Office.Interop.Word.Sentences
Eine Sentences-Auflistung, die alle Sätze im Bookmark-Steuerelement darstellt.

Beispiele

Im folgenden Codebeispiel wird dem Dokument ein Bookmark-Steuerelement mit Text hinzugefügt und der erste Satz im Lesezeichen ausgewählt.

Dieses Beispiel bezieht sich auf eine Anpassung auf Dokumentebene.

Private Sub BookmarkSentences()

    Me.Paragraphs(1).Range.InsertParagraphBefore()
    Dim Bookmark1 As Microsoft.Office.Tools.Word.Bookmark = _
        Me.Controls.AddBookmark(Me.Paragraphs(1).Range, "Bookmark1")

    Bookmark1.Text = "This is the first sentence of bookmark text." _
        & " And this is the second sentence."
    Bookmark1.Sentences.First.Select()

End Sub
private void BookmarkSentences()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();

    Microsoft.Office.Tools.Word.Bookmark bookmark1 =
        this.Controls.AddBookmark(this.Paragraphs[1].Range,
        "bookmark1");
    bookmark1.Text = "This is the first sentence of bookmark text." +
        " And this is the second sentence.";
    bookmark1.Sentences.First.Select();
}

.NET Framework-Sicherheit

Siehe auch

Referenz

Bookmark Schnittstelle

Microsoft.Office.Tools.Word-Namespace