Please Help - How can I assign an Image to a custom Toolbar


Posted by Paul E. on May 11, 2001 7:36 AM

Hello,
I have wrtten VB code that creates a custom toolbar when an excel file is opened. I would like to assign an image to these buttons, but I can't figure out how. Below is an excerpt of the code I use, wherein I am currently assigning a caption to the button. I'd like to remove the caption and put a picture in its place. Any tips on how to accomlish this would be greatly appreciated. Thanks in advance

Paul E.

Private Const CTL_UPDATE As String = "Update"
Dim cbr As CommandBar
Dim ctlInsert As CommandBarButton
.
.
.

' Add button control.
Set ctlInsert = cbr.Controls.Add
With ctlInsert
.Style = msoButtonCaption ' Replace with msoButtonIcon
.Caption = CTL_UPDATE
.Tag = CTL_UPDATE
' Specify procedure that will run when button is clicked.
.OnAction = "Update"
End With

Posted by Duane Kennerson on May 12, 2001 6:28 AM

put ".FaceId = #" where the # is any number 1 and 5680. For example
if you put ".FaceId = 4" you would have the printer icon on your toolbar.
The trick is figuring out wich number goes with wich picture. Experiment
a little.
Hope this helps...
Duane



Posted by Paul E on May 14, 2001 5:25 AM

Thanks for your help Duane