UndoRecord.CustomRecordLevel Property (Word)

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

Version Information

Version Added: Word 2010

Syntax

expression .CustomRecordLevel

expression A variable that represents a 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

Concepts

UndoRecord Object

UndoRecord Object Members