Undo macro

R

Robert

I have a clean up macro that performs a number of steps.
If the result is not what is wanted, is there a way to
undo what the macro has done, sort of like edit>undo but
undoing everything the macro has done? Thanks.
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

If you can count the number of undoable actions performed by the macro, you
can use

Undo(times)

where times in that number, or you can just use a number that will be higher
and use

Dim i as long
For i = 1 To [big number]
ActiveDocument.Undo
Next i


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
 
J

Jay Freedman

Robert said:
I have a clean up macro that performs a number of steps.
If the result is not what is wanted, is there a way to
undo what the macro has done, sort of like edit>undo but
undoing everything the macro has done? Thanks.

Hi, Robert,

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/[email protected]
 
P

Perry

I believe this already answered in one of the other
newsgroups, maybe even this one ....

In such case, pls don't multipost.
If you want your question to reach multiple newsgroups
you had better crosspost yr question.

In case you've missed the answers already provided
maybe superfluous but here's an article

Have a look at
http://word.mvps.org/FAQs/MacrosVBA/GetNoOfReplacements.htm

Krgrds,
Perry
 

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