Revisions object (Word)
A collection of Revision objects that represent the changes marked with revision marks in a range or document.
Use the Revisions property to return the Revisions collection. The following code example displays the number of revisions in the main text story.
MsgBox ActiveDocument.Revisions.Count
The following code example accepts all the revisions in the selection.
For Each myRev In Selection.Range.Revisions
myRev.Accept
Next myRev
The following code example accepts all the revisions in the first paragraph in the selection.
Set myRange = Selection.Paragraphs(1).Range
myRange.Revisions.AcceptAll
The Add method is not available for the Revisions collection. Revision objects are added when change tracking is enabled. Set the TrackRevisions property to True to track revisions made to the document text. The following code example enables revision tracking in the active document and then inserts "The " before the selection.
ActiveDocument.TrackRevisions = True
Selection.InsertBefore "The "
Use Revisions (Index), where Index is the index number, to return a single Revision object. The index number represents the position of the revision in the range or document. The following code example displays the author name for the first revision in the first section.
MsgBox ActiveDocument.Sections(1).Range.Revisions(1).Author
The Count property for this collection in a document returns the number of items in the main story only. To count items in other stories use the collection with the Range object.
Name |
---|
Application |
Count |
Creator |
Parent |
Have questions or feedback about Office VBA or this documentation? Please see Office VBA support and feedback for guidance about the ways you can receive support and provide feedback.