AutoVersion Property

Microsoft Word Visual Basic

AutoVersion Property

       

Returns or sets the state of the option for automatically saving document versions. Can be one of the following read/write WdAutoVersions constants.

WdAutoVersions can be one of these WdAutoVersions constants.
wdAutoVersionOff
wdAutoVersionOnClose

expression.AutoVersion

expression   Required. An expression that returns one of the objects in the Applies To list.

Note   When the AutoVersion property is set to wdAutoVersionOnClose, a document version is automatically saved when the document is closed.

Example

This example disables the option to save a document version automatically when the active document is closed.

ActiveDocument.Versions.AutoVersion = wdAutoVersionOff

This example displays a message in the status bar if the option to save a document version automatically is active for Report.doc.

If Documents("Report.doc").Versions.AutoVersion = _
        wdAutoVersionOnClose Then
    StatusBar = "A version will be automatically saved"
End If