Bookmark.ParagraphFormat Property

Definition

Gets or sets a ParagraphFormat object that represents the paragraph settings for the Bookmark control.

C#
public Microsoft.Office.Interop.Word.ParagraphFormat ParagraphFormat { get; set; }

Property Value

A ParagraphFormat object that represents the paragraph settings for the Bookmark control.

Examples

The following code example adds a Bookmark control with text to the first paragraph and sets the paragraph format of the bookmark to have a one inch SpaceBefore.

This example is for a document-level customization.

C#
private void BookmarkParagraphFormat()
{
    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.";
    bookmark1.ParagraphFormat.SpaceBefore = Application.InchesToPoints(1);
}

Applies to

Product Versions
Visual Studio Tools for Office 2017, 2019, 2022