Expand Minimize

Bookmark.Paragraphs Property

Gets a Microsoft.Office.Interop.Word.Paragraphs collection that represents all the paragraphs in the Bookmark control.

Namespace:  Microsoft.Office.Tools.Word
Assembly:  Microsoft.Office.Tools.Word (in Microsoft.Office.Tools.Word.dll)

Paragraphs Paragraphs { get; }

Property Value

Type: Microsoft.Office.Interop.Word.Paragraphs
A Microsoft.Office.Interop.Word.Paragraphs collection that represents all the paragraphs in the Bookmark control.

The following code example adds a Bookmark control with text to the first paragraph and changes the paragraph to double-spaced lines of text.

This example is for a document-level customization.

private void BookmarkParagraphs()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();

    Microsoft.Office.Tools.Word.Bookmark bookmark1 =
        this.Controls.AddBookmark(this.Paragraphs[1].Range,
        "bookmark1");

    bookmark1.Text = "This example inserts some sample bookmark text" +
        " and will then set the line spacing of the bookmark" +
        " to double space.";
    bookmark1.InsertAfter(" This is text inserted after the bookmark");
    bookmark1.Paragraphs.LineSpacingRule = Word.WdLineSpacing
        .wdLineSpaceDouble;
}

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft