Bookmark.ListFormat Property

Definition

Gets a ListFormat object that represents all the list formatting characteristics of a Bookmark control.

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

Property Value

A ListFormat object that represents all the list formatting characteristics of a 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