Undo list: figuring out how many times to undo

P

Phonon

Hi All,

I'm developing a plug-in for Microsoft Word which performs a series
of actions at the user's request. I would like that series of actions
to be considered as 'one' action in the undo list. Is there way to do
this? Worst case scenario, is there a way to count how many items
there are in the undo list at any time? (that at least would allow me
to take a snapshot before and after the command and undo the
appropriate number of times).

Thank you in advance,
Andrew
 
J

Jonathan West

Phonon said:
Hi All,

I'm developing a plug-in for Microsoft Word which performs a series
of actions at the user's request. I would like that series of actions
to be considered as 'one' action in the undo list. Is there way to do
this? Worst case scenario, is there a way to count how many items
there are in the undo list at any time? (that at least would allow me
to take a snapshot before and after the command and undo the
appropriate number of times).

Thank you in advance,
Andrew

The way to approach this is for you to insert a bookmark at the start of
your series of actions. Delete it at the end.

Then you create an EditUndo macro that does the following

1. Undo one action.
2. Check to see if the bookmark is present.
3. If it isn't present, stop.
4. Go to step 1.

This will cause all your actions to be undone as if they were one item.
 
P

Phonon

The way to approach this is for you to insert a bookmark at the start of
your series of actions. Delete it at the end.

Then you create an EditUndo macro that does the following

1. Undo one action.
2. Check to see if the bookmark is present.
3. If it isn't present, stop.
4. Go to step 1.

This will cause all your actions to be undone as if they were one item.


Sweet! Thank you!
Andrew
 

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