PDA

View Full Version : Changing the name of a button on the Fly



island17
04-13-2006, 09:44 AM
Hello All

I want to be able to change the name of a button on a toolbar on the fly. We have a macro that changes a files column width and then tells us how many inches it is in that format. What I need is to be able to is change the name of a button to the that value. This way a user can see what was the length of a file the last time they ran the macro. I hope I was clear enough.

TonyJollans
04-13-2006, 10:41 AM
The basic statement to do it iscommandbars("YourCommandBar").Controls("YourControl").Caption="YourNewCaption"
You probably want to keep a reference to the control if you're changing it often. You should also be aware that it will change the template to which it belongs and that cahnage will get saved unless you take action to avoid it.