confirmation de lecture mail via VBA
Bonjour à tous,
Je voudrais inséré une confirmation de lecture a mon code existant mais je n'y arrive pas.
J'ai regarder mon outlook permet bien cette manipulation.
Voici le code existant.
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 27 28 29 30 31 32 33 34 35 36 37 38 39
| Sub SendMailData()
Dim Fichier As String
Dim MonOutlook As Object
Dim MonMessage As Object
Dim MyBench As String
Dim NumberOfIntervention As String
Fichier = "H:\SERVICE\MAINTENANCE PREVENTIVE\Archivage fiche d'intervention maintenance\Fichier excel\Archivage fiche d'intervention maintenance"
ThisWorkbook.SaveAs Fichier
MyBench = Sheets("Fiche d'intervention").Range("I10").Value
NumberOfIntervention = Sheets("Fiche d'intervention").Range("N1").Value
Set MonOutlook = CreateObject("Outlook.Application")
Set MonMessage = MonOutlook.createitem(0)
MonMessage.BodyFormat = 2
corps = "<HTML><BODY>"
MonMessage.To = "xxxxxxxx"
MonMessage.cc = ""
MonMessage.Subject = "Demande d'intervention maintenance"
' Le corps du message est divisé en 2 lignes :
corps = corps & "Bonjour Christophe,"
' <p> = Touche ENTER
corps = corps & "<p>"
corps = corps & "<p> Voici la demande d'intervention pour le " & "<b>" & MyBench & "</b>" & " ainsi que le numéro d'intervention " & "<b>" & NumberOfIntervention & "</b></p>"
corps = corps & "<p><a href=""H:\SERVICE\MAINTENANCE PREVENTIVE\Archivage fiche d'intervention maintenance\Fichier excel\Archivage fiche d'intervention maintenance.xlsm"">lien vers l'interface maintenance</a></p>"
corps = corps & "</BODY></HTML>"
MonMessage.HTMLBody = corps
MonMessage.Display
ReadReceiptRequested = True
Set MonOutlook = Nothing
Workbooks("Archivage fiche d'intervention maintenance").Close False
End Sub |
Cordialement
Romain