Bookmark.Revisions Property

Definition

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

public:
 property Microsoft::Office::Interop::Word::Revisions ^ Revisions { Microsoft::Office::Interop::Word::Revisions ^ get(); };
public Microsoft.Office.Interop.Word.Revisions Revisions { get; }
member this.Revisions : Microsoft.Office.Interop.Word.Revisions
Public ReadOnly Property Revisions As Revisions

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.

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

    Bookmark1.Text = "This is sample bookmark text."
    Me.TrackRevisions = True
    Bookmark1.Words(2).Text = "was "

    MessageBox.Show("Total revisions in bookmark: " & _
        Bookmark1.Revisions.Count.ToString)

End Sub

Applies to