bookmarks and redo function

O

Old Lars

==Cross-posting from microsoft.public.word.general==

I've stumbled across something odd in Word 2000 (shocking, I know):

1) I make an editing change.
2) Then I set a bookmark.
3) Then I click Undo, which undoes the bookmark.
4) Then I click Undo, which undoes the editing change.
5) Then I click Redo, which redoes BOTH the editing change AND the
bookmark.

Does this seem right to you all?

(Extra for experts: The Undo and Redo functions I'm referring to are
in fact the standard VBA ActiveDocument.Undo and ActiveDocument.Redo.)
 
P

Pete Bennett

No, I've not noticed that, but then I try not to use undo and redo as much as
I can help it...

But, an interesting little technique that works on the same principle is this:

If you have some code that inserts text and does something faily complex and
you want a way of "undoing" it easily without having to keep track of what's
inserted or how many undos you need to step back. What you can do is put a
bookmark into the document (doesn't matter where as long as it's not around
any text), you cah do your stuff, and then, when you want to undo the
changes, simple keep performing an ActiveDocument.Undo until the bookmark no
longer exists, and then you're back to your start position again.

Simple, eh?

Pete.
 
O

Old Lars

Heh, heh. That's exactly what I'm doing, and it's how I discovered
this oddity. I have one button set to "mega"-undo and it works fine.
But the "mega"-redo redoes all those steps, PLUS an immediately
following editing change.

So if I run a macro that makes several changes under the covers, then
make an editing change, then hit mega-undo twice, it undoes the
editing change, then undoes the macro change. THEN if I hit mega-redo
ONCE, it redoes both the macro change, AND the editing change as
though it too was part of the macro.

I thought it was something wrong with my code until I went back to
basics and tried these steps just with the basic ActiveDocument.Undo
and .Redo. Grrrrr.
 

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