commandbar submenu VBA syntax

T

Toxalot

I can use the following to get to the top item in a commandbar, but
how do I get to a submenu item?

Application.CommandBars("mbMainCC").Controls("Print").Enabled = True

Jennifer
 
A

Albert D. Kallal

Toxalot said:
I can use the following to get to the top item in a commandbar, but
how do I get to a submenu item?

Application.CommandBars("mbMainCC").Controls("Print").Enabled = True

Jennifer

here is some sample of "walking" down to sub menus...

if IsInGroup(CurrentUser,"SuperUser" then

CommandBars("menu bar").
Controls("records").
Controls("refresh").Visible = True

end if

if IsInGroup(CurrentUser(),"InvoideDeleteGroup") = true then

CommandBars("myCustomBar").
Controls("AdminOptions").
Controls("DleeteInvoice").Visible = True

end if

Note that short cut menus are their own name also:

commandbars("your shortcut name").
Contorls("contorlName").visiable = false

Note that I broke up the above into multiple lines for ease of read...

The code will actually looks like:

CommandBars("menu bar").Controls("records").Controls("refresh").Visible =
True
 
T

Toxalot

Thanks.

Now how do I get the selected item from a combobox on a commandbar?

Jennifer
 
Top