Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default personal commandbars

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

--
Thanks.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 595
Default personal commandbars

Jackie

Here's an example

With .Controls.Add(Type:=msoControlButton, befo=.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..._commandb.html

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

"Jackie" wrote in message
...
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:=msoCo
ntrolButton)
With myControl
.Caption = "internet"
.Visible = True
.OnAction = "GetOnline"
.Style = msoButtonCaption
End With

--
Thanks.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Lock Commandbars Jean-pierre Hermans Excel Programming 2 August 22nd 04 08:00 PM
Commandbars Libby Excel Programming 1 August 8th 04 07:11 PM
CommandBars garry Excel Programming 3 June 24th 04 03:12 PM
CommandBars defj Excel Programming 2 November 16th 03 12:57 AM
Built In CommandBars Sander Lablans Excel Programming 0 August 1st 03 11:59 AM


All times are GMT +1. The time now is 08:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"