Bookmark.Revisions Property

Definition

Gets a Revisions collection that represents the tracked changes in the Bookmark control.

C#
public Microsoft.Office.Interop.Word.Revisions Revisions { get; }

Property Value

A Revisions collection that represents the tracked changes in the Bookmark control.

Examples

The following code example adds a Bookmark control with text to the first paragraph, turns on revision tracking, then revises the text. It then displays the number of revisions in a message box.

This example is for a document-level customization.

C#
private void BookmarkRevisions()
{
    this.Paragraphs[1].Range.InsertParagraphBefore();
    
    Microsoft.Office.Tools.Word.Bookmark bookmark1 =
        this.Controls.AddBookmark(this.Paragraphs[1].Range,
        "bookmark1");
    bookmark1.Text = "This is sample bookmark text.";
    this.TrackRevisions = true;
    bookmark1.Words[2].Text = "was ";
    
    MessageBox.Show("Total revisions in bookmark: " +
        bookmark1.Revisions.Count);
}

Applies to

Product Versions
Visual Studio Tools for Office 2017, 2019, 2022