Class Revision (Word VBA)

The class Revision represents a change marked with a revision mark. The Revision object is a member of the Revisions collection. The Revisions collection includes all the revision marks in a range or document.

Set

To use a Revision class variable it first needs to be instantiated, for example

Dim rvs as Revision
Set rvs = ActiveDocument.Range.Revisions(Index:=1)

The following procedures can be used to set variables of type Revision: Revisions.Item, Selection.NextRevision, Selection.PreviousRevision, Document.Revisions and Range.Revisions

For Each

Here is an example of processing the Revision items in a collection.

Dim rvs As Revision
For Each rvs In ActiveDocument.Range.Revisions
	
Next rvs

Themes

The following procedures in this class have been grouped together and are described on a separate theme page

Format with its procedures FormatDescription and Style

Properties

Author returns the name of the user who made the specified tracked change.

Dim strAuthor As String
strAuthor = ActiveDocument.Range.Revisions(1).Author

Cells returns a Cells collection that represents the table cells that have been marked with revision marks.

Dim cllsCells As Cells
Set cllsCells = ActiveDocument.Range.Revisions(1).Cells

Date the date and time that the tracked change was made.

Dim dtToday As Date
dtToday = ActiveDocument.Range.Revisions(1).Date

Index returns a Long that represents the position of an item in a collection.

Dim lngIndex As Long
lngIndex = ActiveDocument.Range.Revisions(1).Index

MovedRange returns a Range object that represents a range of text that was moved from one place to another in a document with tracked changes.

Dim rngMovedRange As Range
Set rngMovedRange = ActiveDocument.Range.Revisions(1).MovedRange

Parent returns an object that represents the parent object of the specified Revision object.

Dim objParent As Object
Set objParent = ActiveDocument.Range.Revisions(1).Parent

Range returns a Range object that represents the portion of a document that's contained within a revision mark.

Dim rngRange As Range
Set rngRange = ActiveDocument.Range.Revisions(1).Range

Type returns the revision type.

Dim wrtType As WdRevisionType
wrtType = ActiveDocument.Range.Revisions(1).Type

Revisions.Count returns a Long that represents the number of revisions in the collection.

Dim lngCount As Long
lngCount = ActiveDocument.Range.Revisions.Count

Revisions.Parent returns an object that represents the parent object of the specified Revisions object.

Dim objParent As Object
Set objParent = ActiveDocument.Range.Revisions.Parent