Undo insert table

N

Neron

Hi all,

I was wondering...
I have a VBA macro in order to insert a table into a document an
setting up font styles, table borders and so on.
If I want to undo this action of inserting this table, I have to use
lot of [Ctrl]+[Z]'s, or clear a large list of previous actions in orde
to get to the state of the document before inserting the tabel.

Is there an easier way to do this? Like create an "UndoRestorePoint" o
a "GroupTheseActions"-action or something like that?

Greetz,

Ber
 
N

Neron

Hi Stefan,

Thanks for the reply.
It's not 'just' for the insert-table-macro; it's more the concept o
undoing a (-n undefined) series of actions, or grouping a set of action
into one Undo-stack action.
e.g. MS Project 2007 had got an "UndoTransaction" for creating a singl
stack item containing multiple actions, but I haven't been able t
figure out how to do this in MS Word.

Greetz,

Bert

'Stefan Blom[_3_ said:
;3681920']Why not just delete the table when/if you want to get rid o
it?
 
T

Tony Jollans

You could clear the Undo stack before you start, but a better way to do it
is to place something uniquely identifiable - a bookmark - in the document
before you start (and to remove it when you're done). To undo, first of all
undo the removal of the bookmark, then keep on undoing as long as the
bookmark is in the document - when the bookmark is gone you know you have
undone its creation and, therefore, everything that came later.

Word 2010 does have something along these lines built in, but some aspects
of its working were unclear to me last time I looked at it.

--
Enjoy,
Tony

www.WordArticles.com

Neron said:
Hi Stefan,

Thanks for the reply.
It's not 'just' for the insert-table-macro; it's more the concept of
undoing a (-n undefined) series of actions, or grouping a set of actions
into one Undo-stack action.
e.g. MS Project 2007 had got an "UndoTransaction" for creating a single
stack item containing multiple actions, but I haven't been able to
figure out how to do this in MS Word.

Greetz,

Bert

'Stefan Blom[_3_ said:
;3681920']Why not just delete the table when/if you want to get rid of
it?
 

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