personal commandbars

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is it possible to have icons on the personalized toolbars instead of "text"?
As in the following sample, how to replace the text "internet" under caption
with a small icon image "such as internet.bmp or gif or jpeg"


Set myControl =
Application.ActiveExplorer.CommandBars("ToolbarOL").Controls.Add(Type:=msoControlButton)
With myControl
.Caption = "internet"
.Visible = True
.OnAction = "GetOnline"
.Style = msoButtonCaption
End With
 
Jackie

Here's an example

With .Controls.Add(Type:=msoControlButton, before:=.Controls.Count +
1)
.Caption = "Trim Google URL"
.TooltipText = .Caption
.OnAction = "Myfunctions.xla!Module2.ShowTrim"
.Visible = True
Sheet2.Shapes("Picture 1").Copy
.PasteFace
End With

The icon is stored as a picture on Sheet2 and is copied. PasteFace is used
to apply the icon to the commandbarbutton. Don't set the Style or set it as
msoButtonIcon to get the icon to show instead of text. The example comes
from here

http://www.dicks-blog.com/excel/2004/05/custom_commandb.html
 

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

Back
Top