共用方式為


Bookmark.ListParagraphs 屬性

取得 ListParagraphs 集合,表示在 Bookmark 控制項中的所有編號段落。

命名空間:  Microsoft.Office.Tools.Word
組件:  Microsoft.Office.Tools.Word (在 Microsoft.Office.Tools.Word.dll 中)

語法

'宣告
ReadOnly Property ListParagraphs As ListParagraphs
    Get
ListParagraphs ListParagraphs { get; }

屬性值

型別:Microsoft.Office.Interop.Word.ListParagraphs
ListParagraphs 集合,表示在 Bookmark 控制項中的所有編號段落。

範例

下列程式碼範例將 Bookmark 控制項加入至第一個段落,並且將預設項目符號清單套用到書籤。

這是示範文件層級自訂的範例。

Private Sub BookmarkListFormat()
    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." & vbLf & _
        "This is the second paragraph of text."
    Bookmark1.ListFormat.ApplyBulletDefault()
    MessageBox.Show("Number of ListParagraphs in the bookmark: " _
        & Bookmark1.ListParagraphs.Count.ToString)

End Sub
private void BookmarkListFormat()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();
    Microsoft.Office.Tools.Word.Bookmark bookmark1 =
        this.Controls.AddBookmark(this.Paragraphs[1].Range,
        "bookmark1");
    bookmark1.Text = "This is sample bookmark text." + "\n" +
        "This is the second paragraph of text.";
    bookmark1.ListFormat.ApplyBulletDefault(ref missing);
    MessageBox.Show("Number of ListParagraphs in the bookmark: " +
        bookmark1.ListParagraphs.Count);
}

.NET Framework 安全性

請參閱

參考

Bookmark 介面

Microsoft.Office.Tools.Word 命名空間