Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2005

Tip: Looking for answers? Try searching our database.

Undo list?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andrew Vaudin - 10 Jan 2005 18:07 GMT
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.......................
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.