Hi.
I've come up with the following (and probably not very good) code to create a custom toolbar and button face in VBA.
Sub addBar()
ActiveWindow.Selection.SlideRange.Shapes.AddShape(msoShapeRectangle, 162.25, 265.5, 44.75, 32#).Select
With ActiveWindow.Selection.ShapeRange
.Fill.Visible = msoTrue
.Fill.Solid
.Fill.ForeColor.RGB = RGB(111, 75, 183)
.Line.Visible = msoTrue
.Line.ForeColor.RGB = RGB(111, 75, 183)
.Line.BackColor.RGB = RGB(255, 255, 255)
.Height = 15#
.Width = 15#
End With
ActiveWindow.Selection.Cut
Set myBar = CommandBars _
.Add(Name:="WM color", Position:=msoBarTop, Temporary:=True)
myBar.Visible = True
Set wealth1 = myBar.Controls _
.Add(Type:=msoControlButton, Id:=CommandBars("Standard").Controls("Copy").Id)
wealth1.OnAction = "ShowColor"
wealth1.PasteFace
End Sub
Could anyone let me know if the above is the logical way to go around things and give me any pointers as to if it can be slimmed down, as i've got to create at least 36 more buttons!
many thanks
I've come up with the following (and probably not very good) code to create a custom toolbar and button face in VBA.
Sub addBar()
ActiveWindow.Selection.SlideRange.Shapes.AddShape(msoShapeRectangle, 162.25, 265.5, 44.75, 32#).Select
With ActiveWindow.Selection.ShapeRange
.Fill.Visible = msoTrue
.Fill.Solid
.Fill.ForeColor.RGB = RGB(111, 75, 183)
.Line.Visible = msoTrue
.Line.ForeColor.RGB = RGB(111, 75, 183)
.Line.BackColor.RGB = RGB(255, 255, 255)
.Height = 15#
.Width = 15#
End With
ActiveWindow.Selection.Cut
Set myBar = CommandBars _
.Add(Name:="WM color", Position:=msoBarTop, Temporary:=True)
myBar.Visible = True
Set wealth1 = myBar.Controls _
.Add(Type:=msoControlButton, Id:=CommandBars("Standard").Controls("Copy").Id)
wealth1.OnAction = "ShowColor"
wealth1.PasteFace
End Sub
Could anyone let me know if the above is the logical way to go around things and give me any pointers as to if it can be slimmed down, as i've got to create at least 36 more buttons!
many thanks