Option Explicit
Public u As Byte
Public CalcTaskID
Public CharmapTaskID
Public Const MyCommandBarName As String = "Carnet d'adresses ..."
Sub DeleteMyCommandBar()
' Efface la barre d'outils MyCommandBarName
    On Error Resume Next
    Application.CommandBars(MyCommandBarName).Delete
    On Error GoTo 0
End Sub
Sub CreateMyCommandBar()
' Création de la barre d'outils personnalisée MyCommandBarName
    Dim cb As CommandBar, cbb As CommandBarButton
    Application.ScreenUpdating = False
    DeleteMyCommandBar    ' au cas où celle-ci existe déjà
    Set cb = Application.CommandBars.Add(MyCommandBarName, msoBarFloating, False, True)
    AddMenuToCommandBar cb, True
End Sub
Private Sub AddMenuToCommandBar(cb As CommandBar, blnBeginGroup As Boolean)
    Dim cbb As CommandBarButton
    If cb Is Nothing Then Exit Sub
    With cb
        ' Ajout d'un item au menu
        Set cbb = cb.Controls.Add(msoControlButton, , , , True)
        With cbb
            .BeginGroup = True
            .Caption = "Rechercher"
            .OnAction = "Inscriptions"
            .TooltipText = "Rechercher un contact ..."
            .Style = msoButtonIconAndCaption
            .FaceId = 25
        End With
        ' Ajout d'un item au menu
        Set cbb = cb.Controls.Add(msoControlButton, , , , True)
        With cbb
            .BeginGroup = True
            .Caption = "Messagerie"
            .OnAction = "Messages"
            .TooltipText = "Envoyer des messages avec pièces jointes ..."
            .Style = msoButtonIconAndCaption
            .FaceId = 1978
            End With
            ' Ajout d'un item au menu
        Set cbb = cb.Controls.Add(msoControlButton, , , , True)
        With cbb
            .BeginGroup = True
            .Caption = "Tâches"
            .OnAction = "Taches"
            .TooltipText = "Effectuer des tâches avec Outlook ..."
            .Style = msoButtonIconAndCaption
            .FaceId = 247
            End With
            ' Ajout d'un item au menu
        Set cbb = cb.Controls.Add(msoControlButton, , , , True)
        With cbb
            .BeginGroup = True
            .Caption = "Réunions"
            .OnAction = "Reunions"
            .TooltipText = "Organiser vos réunions ..."
            .Style = msoButtonIconAndCaption
            .FaceId = 5434
            End With
                      ' Ajout d'un item au menu
        Set cbb = cb.Controls.Add(msoControlButton, , , , True)
        With cbb
            .BeginGroup = True
            .Caption = "Notes"
            .OnAction = "Notes"
            .TooltipText = "Créer une nouvelle note ..."
            .Style = msoButtonIconAndCaption
            .FaceId = 259
            End With
            ' Ajout d'un item au menu
        Set cbb = cb.Controls.Add(msoControlButton, , , , True)
        With cbb
            .BeginGroup = True
            .Caption = "Journal"
            .OnAction = "Journal"
            .TooltipText = "Rechercher un contact ..."
            .Style = msoButtonIconAndCaption
            .FaceId = 195
        End With
            ' Ajout d'un item au menu
        Set cbb = cb.Controls.Add(msoControlButton, , , , True)
        With cbb
            .BeginGroup = True
            .Caption = "Enregistrer"
            .OnAction = "Enregistrer"
            .TooltipText = "Enregistrer les contacts ..."
            .Style = msoButtonIconAndCaption
            .FaceId = 3
            End With
        ' Rendre la barre visible
        .Visible = True
        ' Position dans le cas d'une barre flottante
        .Left = 300
        .Top = 100
    End With
    ' Initialiser les variables
    ' Set ca = Nothing
    Set cb = Nothing
    Set cbb = Nothing
    ' Set msocbbb = Nothing
    ' Set cbo = Nothing
End Sub