共用方式為


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 命名空間