Change faceid of a command bar button from other VBA code?
I have the following code to add a button to my tool bar:
Dim CB As CommandBar
Dim CBB2 As CommandBarButton
Set CB = Application.CommandBars(1)
Set CBB2 = CB.Controls.Add(Type:=msoControlButton, _
before:=CB.Controls.Count, ID:=59, temporary:=True)
With CBB2
.FaceId = 40
.Caption = "Changes to down on enter"
.OnAction = "CBB2CursorMovementRightOrLeft"
End With
For changing the FaceID, I can refer to it by its Caption, eg:
Application.CommandBars(1).Controls("Changes to down on enter").FaceId = 50
How can i refer to it by its OnAction?
Thanks for any & all help. mikeburg
I have the following code to add a button to my tool bar:
Dim CB As CommandBar
Dim CBB2 As CommandBarButton
Set CB = Application.CommandBars(1)
Set CBB2 = CB.Controls.Add(Type:=msoControlButton, _
before:=CB.Controls.Count, ID:=59, temporary:=True)
With CBB2
.FaceId = 40
.Caption = "Changes to down on enter"
.OnAction = "CBB2CursorMovementRightOrLeft"
End With
For changing the FaceID, I can refer to it by its Caption, eg:
Application.CommandBars(1).Controls("Changes to down on enter").FaceId = 50
How can i refer to it by its OnAction?
Thanks for any & all help. mikeburg