Condividi tramite


Proprietà Bookmark.Sentences

Ottiene un insieme Sentences che rappresenta tutte le frasi presenti nel controllo Bookmark.

Spazio dei nomi:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)

Sintassi

'Dichiarazione
ReadOnly Property Sentences As Sentences
    Get
Sentences Sentences { get; }

Valore proprietà

Tipo: Microsoft.Office.Interop.Word.Sentences
Insieme Sentences che rappresenta tutte le frasi presenti nel controllo Bookmark.

Esempi

Nell'esempio di codice seguente viene aggiunto un controllo Bookmark con testo al documento e viene selezionata la prima frase nel segnalibro.

Questo esempio è valido per una personalizzazione a livello di documento.

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();
}

Sicurezza di .NET Framework

Vedere anche

Riferimenti

Bookmark Interfaccia

Spazio dei nomi Microsoft.Office.Tools.Word