Bookmark.ListParagraphs 属性

获取一个 ListParagraphs 集合,该集合表示 Bookmark 控件中的所有编号段落。

命名空间:  Microsoft.Office.Tools.Word
程序集:  Microsoft.Office.Tools.Word(在 Microsoft.Office.Tools.Word.dll 中)

语法

声明
ReadOnly Property ListParagraphs As ListParagraphs
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 命名空间