How can I toggle a macro?

T

tony

I have recorded a macro in Word to set a bookmark at the cursor
position.
I have assigned a key to this macro.
I have recorded another macro in Word to bring the cursor to the
bookmark position and delete the bookmark.
I have assigned another key to this macro.

Is there some way to use one single key to toggle between these two
macros?

Thank you one and all.
========================
Tony Roder, speaking his mind....
 
T

Ted Swirsky

Without having more information I can give you these ideas...

If you only have one bookmark in a document at a time, you can have the
macro check for the existence of the bookmark. If it is there, perform
the actions of your second macro. If it is NOT there, perform the actions
of the first.

Another idea is to have the macro ask when it starts if you want to (S)et
or (P)osition and delete. You enter an S or P and it runs the appropriate
code.

HTH

Ted
 
T

tony

If you only have one bookmark in a document at a time, you can have the
macro check for the existence of the bookmark. If it is there, perform
the actions of your second macro. If it is NOT there, perform the actions
of the first.

Another idea is to have the macro ask when it starts if you want to (S)et
or (P)osition and delete. You enter an S or P and it runs the appropriate
code.

Very good ideas, Ted. Thanks. I'll start reading the help files about
the programming of conditionals.

T.
========================
Tony Roder, speaking his mind....
 

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