共用方式為


Bookmark.ListParagraphs Property

Definition

Gets a ListParagraphs collection that represents all the numbered paragraphs in the Bookmark control.

public:
 property Microsoft::Office::Interop::Word::ListParagraphs ^ ListParagraphs { Microsoft::Office::Interop::Word::ListParagraphs ^ get(); };
public Microsoft.Office.Interop.Word.ListParagraphs ListParagraphs { get; }
member this.ListParagraphs : Microsoft.Office.Interop.Word.ListParagraphs
Public ReadOnly Property ListParagraphs As ListParagraphs

Property Value

A ListParagraphs collection that represents all the numbered paragraphs in the Bookmark control.

Examples

The following code example adds a Bookmark control to the first paragraph and applies the default bulleted-list format to the bookmark.

This example is for a document-level customization.

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

Applies to