Programming Custom Menu Bar

  • Thread starter Thread starter Brian Smith
  • Start date Start date
B

Brian Smith

Is it possible using VBA to put checkmarks beside certain submenu items?
Something tells me that you can't and have to use Windows API functions. If
that is the case, does anyone have any example code of how to use them in
this situation? Also, how does one refer to a certain menu item and submenu
item in VBA? I'm assuming that this can be done but I can't seem to figure
it out.

Thanks.

Brian
 
Brian said:
Is it possible using VBA to put checkmarks beside certain submenu items?
Something tells me that you can't and have to use Windows API functions. If
that is the case, does anyone have any example code of how to use them in
this situation? Also, how does one refer to a certain menu item and submenu
item in VBA? I'm assuming that this can be done but I can't seem to figure
it out.


Check Help for all the properties of the CommandBar object.
I believe there is a State property that will do what you
want for the right type of menu item.
 
Brian Smith said:
Is it possible using VBA to put checkmarks beside certain submenu items?

Hum, you can set the "set" the graphic image used, and that could be a check
mark.

mybuttion.Picture = loadpicture("path to check mark bmp picture).
Also, how does one refer to a certain menu item and submenu
item in VBA? I'm assuming that this can be done but I can't seem to figure
it out.

I assume you mean reference the menu item? (most of my menu items of course
call VBA code), but to reference particular menu item, you can use:

if IsInGroup(CurrentUser,"SuperUser" then

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

end if


A sub menu can be ref by:

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

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

end if

(so, just keep using "contorls" to go down as far as you need).

Note that short cut menus are their own name also:

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


Note that I wrapped those examples...they should be one line...

Note that you can use "enabled" in place of visible...
 
Back
Top