Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All
Expand Minimize

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

© 2015 Microsoft