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
|
Private Sub Application_Startup()
'---------------------------------------------------------------------------------------
' Procédure : Application_Startup
' Auteur : Dolphy35 - http://dolphy35.developpez.com/
' Date : 08/09/2008
' Détail : Création d'un controle dans le menu d'Outlook
'---------------------------------------------------------------------------------------
'
'Déclarations desobjets
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(, , , , True)
'objet Control
With objControl
.Caption = "Créer une réunion"
.FaceId = 462
.Style = msoButtonIconAndCaption
.Tag = "Test Bouton"
.OnAction = "TestBouton"
.Visible = True
End With
'libération des instances
Set objExplorer = Nothing
Set objCommandBar = Nothing
Set objControl = Nothing
End Sub |
Partager