H
Harry-Wishes
I created a toolbar with a couple of buttons associated with a template. What
I would like to do is programmatically have the button do what I instructed
when it is clicked but also have the button self-destruct for lack of a
better term. Essentially, the clicking would have a dual purpose in this
order.
1) Run the script I attached to the button.
2) Delete this very button that launched the script.
In case you're wondering why I would want to do this, I only want the user
to run the script once. Double excecution would be disastrous for the program
I'm designing - trust me. At least this will make it harder to re-run the
script since techically-speaking the script is still available, just not as a
button.
Can this be done? Here is what I have so far.
Dim ctlToggle As Office.CommandBarButton
Set ctlToggle = CommandBars("Letter_Toolbar").Controls(1)
I would like to do is programmatically have the button do what I instructed
when it is clicked but also have the button self-destruct for lack of a
better term. Essentially, the clicking would have a dual purpose in this
order.
1) Run the script I attached to the button.
2) Delete this very button that launched the script.
In case you're wondering why I would want to do this, I only want the user
to run the script once. Double excecution would be disastrous for the program
I'm designing - trust me. At least this will make it harder to re-run the
script since techically-speaking the script is still available, just not as a
button.
Can this be done? Here is what I have so far.
Dim ctlToggle As Office.CommandBarButton
Set ctlToggle = CommandBars("Letter_Toolbar").Controls(1)