Sub EmbedPicture(PathName As String)
Dim MyPicture As String
Dim ligne As Integer
Dim img1 As String
ligne = Me.ComboBox1.ListIndex + 1 'se positionne sur l'index (ligne) du nom combobox
img1 = "D:\Gestion AHI\Bonjour XXXX.jpg"
MyPicture = Mid(PathName, InStrRev(PathName, Application.PathSeparator) + 1)
With CreateObject("Outlook.Application").CreateItem(0)
.HTMLBody = .HTMLBody & "<td valign='middle'><b><img src='" & img1 & "'>"
'.HTMLBody = "<html><p>Cher(e) ami(e) bonjour,</p> En ce jour particulier, un mot du président d'A.H.I</p>" & _
"<img src=cid:" & Replace(MyPicture, " ", "%20") & _
"<p>Bon anniversaire,</p>" & _
"<p>" & "</p></html>"
.Attachments.Add "D:\Gestion AHI\Bonjour XXXX.jpg"
.To = Range("C" & ligne).Value
.Subject = " Anniversaire "
.Display
.Send
End With
'Attendre 5
'Outlook.Quit
End Sub
' ==== fin de procédure envoi du message =