Lancer Outlook via VBA
Résolu
Villette54
Messages postés
300
Date d'inscription
Statut
Membre
Dernière intervention
-
eric2027 Messages postés 289 Date d'inscription Statut Membre Dernière intervention -
eric2027 Messages postés 289 Date d'inscription Statut Membre Dernière intervention -
9 réponses
Bonjour,
sans la virgule cette fois-ci !!!!!!!
un exemple qui marche chez moi:
'Il faut activer la référence "Microsoft Outlook Library" Avant de lancer cette macro,
' Dans l'éditeur VBA: Faire Menu / Tools / Reference / Cocher "Microsoft Outlook Library"
'Ok
sans la virgule cette fois-ci !!!!!!!
un exemple qui marche chez moi:
'Il faut activer la référence "Microsoft Outlook Library" Avant de lancer cette macro,
' Dans l'éditeur VBA: Faire Menu / Tools / Reference / Cocher "Microsoft Outlook Library"
'Ok
Sub SendMail_Outlook()
Dim OL As Object
Dim OLmail As Object
On Error Resume Next
Set OLk_Appli = GetObject("Outlook.Application")
If OLk_Appli Is Nothing Then
'mettre le bon chemin outlook
OLk_OK = Shell("C:\Program Files (x86)\Microsoft Office\Office15\outlook.exe", 1)
End If
Set OL = CreateObject("Outlook.Application")
Set OLmail = OL.CreateItem(0)
With OLmail
.To = "fabiengaluchet@gmail.com"
.Subject = "test_envoi"
.Body = "BLABLA"
'.display
.Send
End With
Set OLmail = Nothing
Set OL = Nothing
Set OLk_Appli = Nothing
End Sub
Merci pour ce code, mais il ne fonctionne pas chez moi (je parle uniquement pour la partie ouverture de Outlook, le reste fonctionne parfaitement.
Je détaillerai plus mon problème dès que j'aurais un peu de temps.
Encore merci, bonne journée.