Suspend Undo Function

M

Mike Faulkner

Hello

OS: Windows XP SP2
App: Office 2003 SP3

I would like to suspend the Undo function in Word. Is it possible using VBA?

Regards
Mike
 
J

Jonathan West

Mike Faulkner said:
Hello

OS: Windows XP SP2
App: Office 2003 SP3

I would like to suspend the Undo function in Word. Is it possible using
VBA?


At the end of a macro you can clear the undo stack entirely using the
UndoClear method.

You can't temporarily turn off undo so that the actions of your macro don't
appear on the undo stack, but everything before and after does.
 
M

Mike Faulkner

Jonathan

Thank you for your reply.

Can the Undo function be permanently turned off?

Regards
Mike
 
J

Jonathan West

Mike Faulkner said:
Jonathan

Thank you for your reply.

Can the Undo function be permanently turned off?

No, but you can make it harder to access it by removing the relevant buttons
from the toolbar and removing the keyboard shortcuts for Ctrl-Z and Ctrl-Y
 
H

Helmut Weber

Hi everybody,
No, but you can make it harder to access it by removing the relevant buttons
from the toolbar and removing the keyboard shortcuts for Ctrl-Z and Ctrl-Y

at least as far as Ctrl-Z is concerned:

Sub EditUndo()
MsgBox "Undo was disabled"
End Sub
--

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Vista Small Business, Office XP
 
J

Jonathan West

Helmut Weber said:
Hi everybody,



at least as far as Ctrl-Z is concerned:

Sub EditUndo()
MsgBox "Undo was disabled"
End Sub

Strictly, that doesn't entirely disable Undo. The user can still go to
EditUndo in the list of Word Commands in the Tools Macros dialog. But I
agree it is one way of making it a lot less accessible!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top