1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| Sub Personnalisé()
'création d'une barre de commande comportant un bouton exécutant la macro test()
Dim bar As CommandBarControls 'initialisation d'un control
'création d'une barre de commande
With commandbars.Add("print", cuiBarFloating, False)
.Visible = True 'rend actif la barre
Set bar = .Controls 'création d'un control
'ajout d'un bouton qui renvoie a la macro test()
With bar.AddCustomButton("Macros", "nicotest.Module1.test", 1, False)
.ToolTipText = "print" 'infobulle
.Caption = "print" 'facultatif
'chemin d'accès de l'icône du bouton
.SetCustomIcon ("C:\Documents and Settings\stagG\Mes documents\Mes images\laser.bmp")
.Tag = .Caption 'facultatif
End With
End With
End Sub |