Changing toolbar button setting from "Default Style" to "Image and Text" in VBA

KeithWilliams

Registered User.
Local time
Today, 20:20
Joined
Feb 9, 2004
Messages
137
Changing toolbar button setting from "Default Style" to "Image and Text" in VBA

Hi,

I want to be able to show or hide the caption on a toolbar button according to the state of my program. I can't find a property of CommandBarControl that does the job. I can't just set the caption to empty string, as I then can't refer to the button again to set it back!

E.g.
CommandBars("Toolbar_SPIV").Controls("Performance Summary").Caption = ""

After this I can no longer refer to
CommandBars("Toolbar_SPIV").Controls("Performance Summary").

You can change the setting for a button using the Customize function of the toolbar, then right-clicking the button and selecting "Default Style" or "Image and Text". Surely there must be a way of accessing this property from within VBA?

I need to do this because in some forms, the number of visible toolbar buttons gets too many to fit in the width of the display, and I figure the least confusing way to manage this is to hide the text on some of them.

Thanks,
Keith.
 

Users who are viewing this thread

Back
Top Bottom