Bookmark.Paragraphs 属性

获取一个 Microsoft.Office.Interop.Word.Paragraphs 集合,该集合表示 Bookmark 控件中的所有段落。

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

语法

声明
ReadOnly Property Paragraphs As Paragraphs
Paragraphs Paragraphs { get; }

属性值

类型:Microsoft.Office.Interop.Word.Paragraphs
一个 Microsoft.Office.Interop.Word.Paragraphs 集合,表示 Bookmark 控件中的所有段落。

示例

下面的代码示例向第一个段落添加一个带有文本的 Bookmark 控件,并将该段落更改为双倍行距的文本。

此示例针对的是文档级自定义项。

Private Sub BookmarkParagraphs()

    Me.Paragraphs(1).Range.InsertParagraphBefore()
    Dim Bookmark1 As Microsoft.Office.Tools.Word.Bookmark = _
        Me.Controls.AddBookmark(Me.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

End Sub
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;
}

.NET Framework 安全性

请参见

参考

Bookmark 接口

Microsoft.Office.Tools.Word 命名空间