Collapse the table of content
Expand the table of content
Expand Minimize

ApplicationSettings.UndoLevels Property (Visio)


Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Determines the number of consecutive actions the user can undo in Microsoft Visio. Read/write.

expression .UndoLevels

expression A variable that represents an ApplicationSettings object.

Return Value


Setting the UndoLevels property is equivalent to setting the Undo levels option on the General tab in the Visio Options dialog box (click the File tab, and then click Options).

The minimum possible value for UndoLevels is 0 (zero); the maximum is 99. The default value is 20.

The higher the value of UndoLevels, the more memory is required to store the actions.

This Microsoft Visual Basic for Applications (VBA) macro shows how to use the UndoLevels property to print the current number of undo levels in the Immediate window. It also shows how to get an ApplicationSettings object from the Visio Application object.

Public Sub UndoLevels_Example() 
    Dim vsoApplicationSettings As Visio.ApplicationSettings 
    Dim lngUndoLevels As Long 
    Set vsoApplicationSettings = Visio.Application.Settings 
    lngUndoLevels = vsoApplicationSettings.UndoLevels 
    Debug.Print lngUndoLevels 
End Sub
© 2015 Microsoft