Telling a second macro that a first macro has been run

L

Larry

I run a macro, then I make some changes in the document, then I run a
second macro. I need a method by which the second macro will not run
unless the first macro has been run. I suppose this could be done with
a Public Function that uses a Boolean. In other words, the first macro
sets the public function to true, and then, when the second macro is
complete, it sets the Function back to false.

How is this done? Normally, when macro runs a function, the function
returns some information, which the macro then uses. But in this case
I'm wanting the macro itself to alter what's in the function, in order
for another macro to pick that up.

Thanks,
Larry
 
D

Doug Robbins

You could have the first macro set a value for a document variable in the
document and have the second macro check for the value.

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 
L

Larry

Neat. I set something up in which I create and/or set the variable in
the first macro, then in the second macro I check for both the existence
and the value of the variable and proceed on that basis.

Thanks Doug.

Larry
 
D

Doug Robbins

You may actually want to create the variable in the template with that value
initially set to the false value. Then if macro 2 is run before macro 1,
you would avoid the problem of the variable not existing.

--
Please respond to the Newsgroup for the benefit of others who may be
interested. Questions sent directly to me will only be answered on a paid
consulting basis.

Hope this helps,
Doug Robbins - Word MVP
 

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