event with commandbar button right-click?
OK, but what I want to do is somehow point to the menu item (not the routine
that is pointed at by the menu item) and then get the help related to that
menu
item. Not sure how your .HelpContextID = 69 in the menu code would fit in
with
this.
One problem is that I can't show a WhatsthisHelp button in my userform as
the title bar has minimize and maximize buttons added by the Windows API.
What I could do, althought it is not that slick is have a checkbox on the
form and
then when this is ticked and you click (left-click) the menu item the help
will popup
and not the normal menu routine.
I will report back when I have a solution for this and I would be interested
if you
have some new ideas.
RBS
"Sean Connolly" .(DoNotSpam) wrote in
message ...
Hi,
Not so sure about right-click, but Office CommandBar controls (2k3) do
have
.HelpFile and .HelpContextId properties that can be set. Look these up in
the
Excel VBA help - where it also says that "Help topics respond to
Shift+F1".
So maybe something like ...
With .Controls.Add(Type:=msoControlButton)
.Caption = "Open report (F3 OR O from the treeview)"
.OnAction = "OpenReport"
.FaceId = 23
.HelpFile = "C:\...\myHelpFile.hlp" ' Full path to your compiled
help
file.
.HelpContextID = 69
' The topic ID number that has been correctly mapped to a topic in your
compiled help file.
End With
Don't know if this also works with HtmlHelp compiled help files (*.chm) or
not - I'm having my own set of problems with text-popup context-sensitive
help (see my other post) from HtmlHelp.
Trust this helps and let me know how you get on.
Cheers, Sean.
"RB Smissaert" wrote:
Would it somehow be possible to trigger an event on right-clicking a
commandbar button?
These buttons are created like this:
Public cb2 As CommandBar
Set cb2 = CommandBars.Add("MyOptionsPopUp", _
msoBarPopup, _
MenuBar:=False, _
temporary:=True)
With cb2
Set FileControl = .Controls.Add(Type:=msoControlPopup)
With FileControl
.Caption = "File"
With .Controls.Add(Type:=msoControlButton)
.Caption = "Open report (F3 OR O from the treeview)"
.OnAction = "OpenReport"
.FaceId = 23
End With
etc.
The purpose is to trigger context sensitive help on the menu.
RBS
|