共用方式為


Bookmark.WholeStory 方法

展開 Bookmark 控制項,以包含整個 Story。

命名空間:  Microsoft.Office.Tools.Word
組件:  Microsoft.Office.Tools.Word (在 Microsoft.Office.Tools.Word.dll 中)

語法

'宣告
Sub WholeStory
void WholeStory()

範例

下列程式碼範例將文字加入至文件,然後加入有文字的 Bookmark。 使用 WholeStory 方法展開書籤以包含整個文件。

這是示範文件層級自訂的範例。

Private Sub BookmarkWholeStory()

    Me.Paragraphs(1).Range.InsertParagraphBefore()
    Me.Paragraphs(1).Range.InsertParagraphBefore()
    Me.Paragraphs(1).Range.Text = "This is the first paragraph."

    Dim Bookmark1 As Microsoft.Office.Tools.Word.Bookmark = _
        Me.Controls.AddBookmark(Me.Paragraphs(2).Range, "Bookmark1")

    Bookmark1.Text = "This is sample bookmark text."
    Bookmark1.WholeStory()
    MessageBox.Show("Bookmark1 starts at " & _
        Bookmark1.Start.ToString)

End Sub
private void BookmarkWholeStory()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();
    this.Paragraphs[1].Range.InsertParagraphBefore();
    this.Paragraphs[1].Range.Text = "This is the first paragraph.";

    Microsoft.Office.Tools.Word.Bookmark bookmark1 =
        this.Controls.AddBookmark(this.Paragraphs[2].Range,
        "bookmark1");
    bookmark1.Text = "This is sample bookmark text.";
    bookmark1.WholeStory();
    MessageBox.Show("bookmark1 starts at " + bookmark1.Start.ToString());
}

.NET Framework 安全性

請參閱

參考

Bookmark 介面

Microsoft.Office.Tools.Word 命名空間