This documentation is archived and is not being maintained.

Undo Method

Visual Studio .NET 2003

Reverses the action last performed by the user in the document.

[Visual Basic .NET]
Public Function Undo() As Boolean
[Visual Basic 6]
Function Undo() As Boolean
HRESULT __stdcall Undo(
   /* [out, retval] */ VARIANT_BOOL* retVal
public bool Undo();
[JScript .NET]
public function Undo() : Boolean

Return Value

Returns True if the last action can be reversed, False if not.


Sub UndoExample()
   ' Create a new text file.
   DTE.ItemOperations.NewFile("General\Text File")

   If Not DTE.ActiveDocument.Undo Then
      MsgBox("There are no actions to undo.")
      MsgBox("Actions undone.")
   End If
End Sub

See Also

Redo Method

Applies To: Document Object