Jarosite99
Technical User
Hi. This must be possible but I can't do it.
What I want to do is return the name of the current context menu as though I had right-clicked at the selection point. I know how to add menu items to builtin menus like this:
Set myControl = CommandBars("Text").Controls.Add(Type:=msoControlComboBox, Before:=1)
With myControl
.AddItem Text:="First Item", Index:=1
End With
End Sub
but that is not what I want to do as I am not adding a menu item.
I merely want to return the name of the context menu relevant to the selection point because of the rich information it provides about the place in the document (much better than range, story etc IMHO).
(So I want to be able to return the information represented by the builtin menus that are listed if you right-click the menu bar and click Customize, Shortcut Menus. I know that some or all of this info is available via various other methods but it would be simpler if I could get it via the shortcut menus.)
I have tried things like msgbox(CommandBars.Name) until the cows came home. No luck.
Thanks in anticipation.
What I want to do is return the name of the current context menu as though I had right-clicked at the selection point. I know how to add menu items to builtin menus like this:
Set myControl = CommandBars("Text").Controls.Add(Type:=msoControlComboBox, Before:=1)
With myControl
.AddItem Text:="First Item", Index:=1
End With
End Sub
but that is not what I want to do as I am not adding a menu item.
I merely want to return the name of the context menu relevant to the selection point because of the rich information it provides about the place in the document (much better than range, story etc IMHO).
(So I want to be able to return the information represented by the builtin menus that are listed if you right-click the menu bar and click Customize, Shortcut Menus. I know that some or all of this info is available via various other methods but it would be simpler if I could get it via the shortcut menus.)
I have tried things like msgbox(CommandBars.Name) until the cows came home. No luck.
Thanks in anticipation.