Re: Undo list: figuring out how many times to undo

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



On Aug 1, 12:46 pm, "Jonathan West" <jw...@xxxxxxxx> wrote:
"Phonon" <andre...@xxxxxxxxx> wrote in message

news:1185978705.859095.254900@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

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.

--
Regards
Jonathan West - Word MVPwww.intelligentdocuments.co.uk
Please reply to the newsgroup


Sweet! Thank you!
Andrew

.



Relevant Pages

  • Re: Page numbering conversion from Mac version FIle Series
    ... Mark the numpages field in doc1 with a bookmark "TotPages" ... This message is posted to a newsgroup. ... >>"Master Document" is a term of art in Word referring to ... >>a start on using calculation fields in page numbering. ...
    (microsoft.public.word.formatting.longdocs)
  • Re: Table wont hide
    ... Please reply to the newsgroup unless you wish to avail yourself of my ... is accomplished by wrapping the content in a bookmark and setting the ... Public Sub HideBookmarkRange ... paragraph before the table. ...
    (microsoft.public.word.vba.general)
  • Re: Clearning Bookmark data
    ... Please reply to the newsgroup unless you wish to avail yourself of my ... Doug Robbins - Word MVP, ... It really would help if I could blank out existing data following a bookmark ...
    (microsoft.public.word.vba.general)
  • Re: "Error, Bookmark not defined" - customize font
    ... Please reply to the newsgroup unless you wish to avail yourself of my ... Doug Robbins - Word MVP ... that the document that has the INCLUDETEXT statements in CODE view looks ... Bookmark not defined" will have to be the identical ...
    (microsoft.public.word.vba.general)
  • Re: Auto duplicating regions?
    ... Please post all follow-ups to the newsgroup. ... user to have to change their Word options. ... So, looks like macro is ... cross-reference to a bookmark without having to manually type in the bookmark ...
    (microsoft.public.word.docmanagement)