Bonjour,

j'ai crée une macro outlook qui permet de créer un menu personnalisé dans la barre de menus.

Seulement, quand je ferme outlook et que je ré-ouvre, le bouton disparaît, je dois relancer la macro.

Voici le code de la macro :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
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
36
37
38
39
40
41
42
43
44
45
Option Explicit
 
Dim newItem
 
 
Sub Nouvelle_Réunion()
 
    Dim sPathUser As String
    sPathUser = Environ$("USERPROFILE") & "\Application Data\Microsoft\Outlook\reunion.oft"
    Set newItem = Application.CreateItemFromTemplate(sPathUser)
    newItem.Display
    Set newItem = Nothing
 
End Sub
 
 
Sub Créer_bouton()
 
    'Déclarations des objets
    Dim objExplorer As Outlook.Explorer
    Dim objCommandBar As Office.CommandBar
    Dim objControl As Office.CommandBarButton
 
    'instance des objets
    Set objExplorer = Outlook.ActiveExplorer
    Set objCommandBar = objExplorer.CommandBars.Item("Menu Bar")
    Set objControl = objCommandBar.Controls.Add(, , , , False)
 
 
    'objet Control
    With objControl
        .Caption = "Créer une réunion"
        .FaceId = 462
        .Style = msoButtonIconAndCaption
        .Tag = "Nouvelle Réunion"
        .OnAction = "Nouvelle_Réunion"
        .Visible = True
    End With
 
    'libération des instances
    Set objExplorer = Nothing
    Set objCommandBar = Nothing
    Set objControl = Nothing
 
End Sub
Est-ce qu'il y à une réinitialisation automatique quelque part ?

J'ai d'autres postes avec la même configuration auquel il n'y à pas de problèmes, le poste est équipé de Windows XP, Outlook 2007 avec un compte Exchange.

Merci de vos réponses