Macros, buttons, and parameters - how to?

B

Byron

I realize that you can't pass parameters to macros but I need to
"fake" it somehow. I have a macrobutton that will be used in several
places to display a listbox to the user and let them make a selection.
The macro them sets the result of an adjacent textfield to what the
user selected. My problem is that this was designed to only be used
in one place in the old documents. Now they want it in several
places. Same list, same choices, but more places to store the
individual results. I recall reading something about using "private"
hidden fields to pass the name of the textbox to fill but I can't find
it. Can someone help me out please? Thanks,
 
J

Jezebel

You could fake the parameter by defining a bookmark for each macrobutton.
When the button is clicked, work out which hidden bookmark you are in and
use that to determine which textbox to fill. If you add the bookmarks via
VBA and give them names that begin with underscore, they will be hidden from
the user.

'Private' is a WordPerfect concept.
 
B

Byron

Thanks, it's working all over the document now!

Jezebel said:
You could fake the parameter by defining a bookmark for each macrobutton.
When the button is clicked, work out which hidden bookmark you are in and
use that to determine which textbox to fill. If you add the bookmarks via
VBA and give them names that begin with underscore, they will be hidden from
the user.

'Private' is a WordPerfect concept.
 

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