Vorhandene Symbolleiste erweitern

30.05.2002

 

Dieses Beispiel erweitert die Symbolleiste "Formtierung"
um ein weiteres Symbol und weist diesem Symbol ein Makro zu:

 
Sub Symbolleiste_erweitern()
  Call Symbol_löschen
  Set CB = Application.CommandBars("Formatting"). _
     Controls.Add(msoControlButton)
  With CB
    .Caption = "Befehl"
    .FaceId = 66
    .OnAction = "MachWas"
    .Visible = True
  End With
End Sub
Sub Symbol_löschen()
    On Error Resume Next
    Application.CommandBars("Formatting"). _
       Controls("Befehl").Delete
End Sub
Sub MachWas()
    MsgBox "Hallo, da bin ich !"
End Sub

 

Beispieldatei - 9 KB