Bonjour,
J'ai le code suivant qui marche parfaitement à partir d'Outlook pour interagir avec un email ouvert (ajout de destinataire) :
Je ne vois pas en revanche comment le faire fonctionner à partir d'excel, pour qu'il puisse interragir mon mail ouvert dans Outlook.
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 Sub Test() Dim Item As outlook.MailItem Dim oInspector As Inspector Set oInspector = Application.ActiveInspector If oInspector Is Nothing Then Set Item = Application.ActiveExplorer.Selection.Item(1) Item.Display 'Force the po-up Set oInspector = Application.ActiveInspector 'Reassign oInpsector and Item again Set Item = oInspector.CurrentItem Else Set Item = oInspector.CurrentItem Item.To = "test@mail.com" End If End Sub
Malgré la création de l'objet Outlook, le debug pointe toujours sur "Dim Item As outlook.MailItem".
Ai-je une déclaration supplémentaire à faire?
Merci d'avance
Partager