Versions Property

Microsoft Word Visual Basic

Returns a Versions collection that represents all the versions of the specified document. Read-only.

For information about returning a single member of a collection, see Returning an Object from a Collection.

Example

This example displays the user name and date of the most recent version of the document.

If ActiveDocument.Versions.Count >= 1 Then
    Set aVersion = _
        ActiveDocument.Versions(ActiveDocument.Versions.Count)
    MsgBox "Saved by " & aVersion.SavedBy & " on " & aVersion.Date
End If
		

This example saves a version of Contract.doc with a short comment.

Documents("Contract.doc").Versions.Save _
    Comment:="Added a single word"