Accéder à un onglet précis du ruban
Bonjour,
En suivant ce tuto dans la faq on a accès à l'onglet "Complément", hors je voudrais avoir accès à un autre onglet.
http://outlook.developpez.com/faq/?p...VBA_CommandBar
Dans le code:
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
| Private Sub Test_Application_Startup()
'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 objCommandBar = objExplorer.CommandBars.Item("Airmom")
Set objControl = objCommandBar.Controls.Add(, , , , True)
'objet Control
With objControl
....
....
....
End With
'libération des instances
Set objExplorer = Nothing
Set objCommandBar = Nothing
Set objControl = Nothing
End Sub |
Je voudrais remplacer
Code:
1 2
|
Set objCommandBar = objExplorer.CommandBars.Item("Menu Bar") |
Par
Code:
1 2
|
Set objCommandBar = objExplorer.CommandBars.Item("MonOngletDejaCree") |
Mais ça ne fonctionne pas. J'ai donc essayé avec le numéro d'item mais en vain....
Si quelqu'un avait une idée, ce serait super cool....
Bonne journée
@ +++ Kris