Tooltip or StatusBar msgs for menu items

G

Guest

Hello,

Is there a way to show tooltips for custom CommandBar menu 'items'? None
appear even though I've set the 'TooltipText' property for each item, and the
'Show ScreenTips on toolbars' option in the Customize window is checked.

Or, if this is not doable in xl2003 then is there a way to show a custom
message when the user does a mouse-over on a menu item in a drop-down?

Thanks
 
C

Chip Pearson

The following code works for me.

Dim CmdBar As Office.CommandBar
Dim Ctrl As Office.CommandBarControl
Set CmdBar = Application.CommandBars.Add(Name:="MyName", temporary:=True)
Set Ctrl = CmdBar.Controls.Add(Type:=msoControlButton, temporary:=True)
With Ctrl
.Caption = "Click Me"
.TooltipText = "This is the Tooltip Text"
.Enabled = True
.Style = msoButtonCaption
End With
CmdBar.Visible = True


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)
 
G

Guest

How about submenu items - "MenuItem Tooltip Text" in the revision below
doesn't appear upon mouse-over;

Dim CmdBar As Office.CommandBar
Dim Ctrl As Office.CommandBarControl
Dim ctlMenuItem As CommandBarControl

Application.CommandBars("MyName").Delete

Set CmdBar = Application.CommandBars.Add(Name:="MyName", Temporary:=True)
Set Ctrl = CmdBar.Controls.Add(Type:=msoControlPopup, Temporary:=True)

With Ctrl
.Caption = "MainMenu"
.TooltipText = "MainMenu Tooltip Text"
.Enabled = True
End With

Set ctlMenuItem = Ctrl.Controls.Add(Type:=msoControlButton, Temporary:=True)
With ctlMenuItem
.Caption = "Click Me"
.TooltipText = "MenuItem Tooltip Text"
.Enabled = True
.Style = msoButtonCaption
End With
CmdBar.Visible = True
 
C

Chip Pearson

I see what you mean. I can't get the ToolTip text to display.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
(email address is on the web site)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top