Freigeben über


Bookmark.Range-Eigenschaft

Ruft ein Range-Objekt ab, das den Teil eines Dokuments darstellt, der im Bookmark-Steuerelement enthalten ist.

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

Syntax

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

Eigenschaftswert

Typ: Microsoft.Office.Interop.Word.Range
Ein Range-Objekt, das den Teil eines Dokuments darstellt, der im Bookmark-Steuerelement enthalten ist.

Beispiele

Im folgenden Codebeispiel wird dem ersten Absatz ein Bookmark-Steuerelement mit Text hinzugefügt. Anschließend wird der Text im Lesezeichen fett formatiert.

Dieses Beispiel bezieht sich auf eine Anpassung auf Dokumentebene.

Private Sub BookmarkRange()
    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 sample bookmark text."
    Bookmark1.Range.Bold = True

End Sub
private void BookmarkRange()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();
    int WordTrue = 1;
    Microsoft.Office.Tools.Word.Bookmark bookmark1 =
        this.Controls.AddBookmark(this.Paragraphs[1].Range,
        "bookmark1");
    bookmark1.Text = "This is sample bookmark text.";
    bookmark1.Range.Bold = WordTrue;
}

.NET Framework-Sicherheit

Siehe auch

Referenz

Bookmark Schnittstelle

Microsoft.Office.Tools.Word-Namespace