Partager via


Bookmark.WholeStory, méthode

Étend un contrôle Bookmark pour inclure l'article en entier.

Espace de noms :  Microsoft.Office.Tools.Word
Assembly :  Microsoft.Office.Tools.Word (dans Microsoft.Office.Tools.Word.dll)

Syntaxe

'Déclaration
Sub WholeStory
void WholeStory()

Exemples

L'exemple de code suivant ajoute du texte au document, puis ajoute un Bookmark avec du texte.À l'aide de la méthode WholeStory, il étend le signet pour inclure le document entier.

Cet exemple illustre une personnalisation au niveau du document.

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());
}

Sécurité .NET Framework

Voir aussi

Référence

Bookmark Interface

Microsoft.Office.Tools.Word, espace de noms