How do I make multiple actions in a macro appear as a single entry in the
undo list?
thanks - androooooooooooooooooooo.......................
Jay Freedman - 10 Jan 2005 19:40 GMT
>How do I make multiple actions in a macro appear as a single entry in the
>undo list?
>
>thanks - androooooooooooooooooooo.......................
Hi Andrew,
A few years ago a gentleman named Roemer Lievaart posted an ingenious
method of using a bookmark to track how many Undo actions are needed
to remove the effect of a macro. See if his technique helps:
http://groups.google.com/groups?selm=387f8417.9282415%40news.xs4all.nl

Signature
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Jezebel - 10 Jan 2005 21:00 GMT
The trick is to put a 'marker event' into the list at the beginning and end
of the macro. I redefine a bookmark as the marker event. When the document
opens set the bookmark to point to the end of document.
At the start of the macro set the bookmark to point to the start of the
document; at the end of the macro re-set it to point to the end. Even if the
document is empty, these are different positions. (Give the bookmark a name
that begins with underscore so it's hidden from the user.)
Trap the Undo event by writing a macro called EditUndo. In that macro, check
the position of the bookmark. Undo one command. If the bookmark was at the
end and is now at the beginning, you're undoing your macro: keep undoing
until the bookmark moves again.
Do the same in reverse for Redo.
> How do I make multiple actions in a macro appear as a single entry in the
> undo list?
>
> thanks - androooooooooooooooooooo.......................