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
   |  
    Dim objOL As Object, ObjMail As Object
    Dim oAttach As Object, ColAttach As Object
 
    Set objOL = CreateObject("Outlook.Application")
    Set ObjMail = objOL.CreateItem(0)
    Set ColAttach = ObjMail.attachments
    Set oAttach = ColAttach.Add("C:\Koala.jpg") 'Changer le chemin et le nom de l'image
 
    With ObjMail
        .to = Cells(8, 11)
        .CC = Cells(9, 11)
        .Subject = Cells(7, 11) & "Test" & Cells(7, 3)
        .HTMLBody = "<BODY><FONT face=Arial color=#000080 size=2></FONT>" & _
            "Bonjour, <br><br><IMG src=cid:Koala.jpg></BODY>"   'Nom de l'image sans chemin
        ObjMail.Save
        .Display    'Send   Display permet d'afficher le message, Send l'envoie sans affichage
    End With
 
'    ActiveWorkbook.Close
 
    Set oAttach = Nothing
    Set ColAttach = Nothing
    Set ObjMail = Nothing
    Set objOL = Nothing | 
Partager