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
Cut
Run
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
[C++]
HRESULT __stdcall Undo(
   /* [out, retval] */ VARIANT_BOOL* retVal
);
[C#]
public bool Undo();
[JScript .NET]
public function Undo() : Boolean

Return Value

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

Example

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.")
   Else
      MsgBox("Actions undone.")
   End If
End Sub

See Also

Redo Method

Applies To: Document Object

Show:
© 2015 Microsoft