UndoRecord.CustomRecordLevel property (Word)

Returns a Long that specifies the number of custom undo action calls that are currently active. Read-only.

Syntax

expression. CustomRecordLevel

expression A variable that represents an UndoRecord object.

Remarks

If no custom undo action is active, this property is set to 0.

Example

The following code example verifies that a custom undo record is currently recording. If not, the code creates a custom undo record. Finally, the code verifies that any custom undo action calls are active. If so, a message is printed to the Debug window.

Dim objUndo As UndoRecord
 
Sub MyFunction()
    Set objUndo = Application.UndoRecord
    
    ' Verify that a custom undo record is already being recorded, and if not, start one
    If objUndo.IsRecordingCustomRecord = False Then
        objUndo.StartCustomRecord ("New Undo Record")
    End If
    ' Add some actions here.
    objUndo.EndCustomRecord
    
    ' Verify that any custom undo action calls are currently active.
    If objUndo.CustomRecordLevel > 0 Then
        Debug.Print "An undo record call was not closed!"
    End If
End Sub

See also

UndoRecord Object

Support and feedback

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.