Afficher image+text sur une barre d'outils perso. créée via VBA
Bonjour,
J'ai crée une macro qui crée une barre personnalisé avec des boutons, mais lorsque la barre est crée, elle n'affiche que l'image du bouton et pas le nom.
Est-ce que vous savez comment définir l'affichage de "Image + Nom" ?
Voici mon VBA modifié à partir du code du tuto de Fring :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
| Sub Workbook_Open()
'
' OPEN_BARRE Macro
' ouvre la Barre d'outils
Dim CmdBar As CommandBar
Dim Bouton As CommandBarButton
'Création de la barre d'outils nommée 'Macros'
Set CmdBar = Application.CommandBars _
.Add(Name:="outils_OPE", Position:=msoBarTop, Temporary:=True)
'Ajout de 3 boutons dans la barre d'outils
Set Bouton = CmdBar.Controls.Add(Type:=msoControlButton)
With Bouton
.FaceId = 173
.Caption = "01"
.OnAction = "Sauvegardejanvier"
End With
Set Bouton = CmdBar.Controls.Add(Type:=msoControlButton)
With Bouton
.Caption = "Cacher"
.FaceId = 342
.OnAction = "Cacher"
End With
Set Bouton = CmdBar.Controls.Add(Type:=msoControlButton)
With Bouton
.Caption = "Afficher"
.FaceId = 343
.OnAction = "Afficher"
End With
CmdBar.Visible = True
End Sub |
Merci d'avance à tous !
******************************************************************************************************
Finalement ce n'est plus nécessaire une personne m'a répondu sur un autre forum.
Voici la solution :
Code:
1 2 3 4 5 6
| With Bouton
.Style = msoButtonIconAndCaptionBelow
.Caption = "Cacher"
.FaceId = 342
.OnAction = "Cacher"
End With |