Sub EmbedPicture(PathName As String)
Dim MyPicture As String
Dim img1 As String
Workbooks("donnees.xlsm").Activate
ligne = Me.ComboBox1.ListIndex + 1 '--- se positionne sur l'index (ligne) du nom combobox
' CHEMIN ======
NomFichierComplet = UserForm1.chemin2 & "\Relance XXXX.jpg"
'-- Userform1.chemin2 = "D:\Gestion AHI V2"
img1 = NomFichierComplet ' ---- "D:\Gestion AHI V2\Relance 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 & "'>"
'-- cette ligne fonctionne
.Attachments.Add "img1" '--- si on veut mettre la photo en pièce jointe ----
'-- cette ligne ne fonctionne pas
'========================================================
.To = Range("C" & ligne).Value
.Subject = " Votre cotisation à A.H.I "
.Display
'.Send
End With
End Sub