Discussion:
Undo insert table
(too old to reply)
Neron
2010-03-22 12:43:51 UTC
Permalink
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


--
Neron
Stefan Blom
2010-03-22 18:28:53 UTC
Permalink
Why not just delete the table when/if you want to get rid of it?
--
Stefan Blom
Microsoft Word MVP
Post by Neron
Hi all,
I was wondering...
I have a VBA macro in order to insert a table into a document and
setting up font styles, table borders and so on.
If I want to undo this action of inserting this table, I have to use a
lot of [Ctrl]+[Z]'s, or clear a large list of previous actions in order
to get to the state of the document before inserting the tabel.
Is there an easier way to do this? Like create an "UndoRestorePoint" or
a "GroupTheseActions"-action or something like that?
Greetz,
Bert
--
Neron
Neron
2010-03-23 10:37:27 UTC
Permalink
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
;3681920']Why not just delete the table when/if you want to get rid o
it?
--
Stefan Blom
Microsoft Word MVP
--
Neron
Tony Jollans
2010-03-23 12:38:45 UTC
Permalink
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
Post by Neron
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
;3681920']Why not just delete the table when/if you want to get rid of
it?
--
Stefan Blom
Microsoft Word MVP
--
Neron
Loading...