ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Getting the Label or Caption of MenuItem Selected (https://www.excelbanter.com/excel-programming/288785-getting-label-caption-menuitem-selected.html)

Brian Stigler

Getting the Label or Caption of MenuItem Selected
 
I've created a custom menu on the command bar with a handfull of menu items
and some sub-menu items. I have assigned an on-action event to each of
these but would like to be able to get the caption property for the menu
item or sub-menu item selected.

Is there a way to get this information other than by the fact that the event
goes to the assigned on-action routine?

Thanks,
B



Bob Phillips[_6_]

Getting the Label or Caption of MenuItem Selected
 
Brian,

As soon as a commandbar is selected/clicked the OnAction macro is invoked.
So why would you not get the caption at that point. You can get the caption
with

Application.CommandBars.ActionControl.Caption

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"Brian Stigler" wrote in message
...
I've created a custom menu on the command bar with a handfull of menu

items
and some sub-menu items. I have assigned an on-action event to each of
these but would like to be able to get the caption property for the menu
item or sub-menu item selected.

Is there a way to get this information other than by the fact that the

event
goes to the assigned on-action routine?

Thanks,
B






All times are GMT +1. The time now is 02:37 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com