Document.UndoClear method (Word)

Clears the list of actions that can be undone for the specified document.

Syntax

expression. UndoClear

expression Required. A variable that represents a Document object.

Remarks

This method corresponds to the list of items that appears when you click the arrow beside the Undo button on the Standard toolbar. Include this method at the end of a macro to keep Visual Basic actions from appearing in the Undo box (for example, "VBA-Selection.InsertAfter").

Example

This example clears the list of actions that can be undone for the active document.

ActiveDocument.UndoClear

See also

Document 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.