SetCommandBarButtonColor()
The following routine sets the color of a
CommandBarButton. It does this by creating a bitmap (bmp) file with that color
picture in it and then loading it to the CommandBarButton's Picture property.
Sub SetCommandBarButtonColor(ByVal CBB
As CommandBarButton, ByVal Color
As Long)
Dim Pres As Presentation
Dim Sld As Slide
Dim Shp As Shape
Set Pres = Presentations.Add(False)
Set Sld = Pres.Slides.Add(1, ppLayoutBlank)
Set Shp = Sld.Shapes.AddShape(msoShapeRectangle, 1, 1, 16, 16)
Shp.Line.Visible = False
Shp.Fill.ForeColor.RGB = Color
Shp.Copy
CBB.PasteFace
Pres.Close
End Sub
Click
here for Windows
side of this code.
|
|
|