Re : Envoie de mail + Corp + Pieces Jointe + ObBot par apport au tableau
non c'est bonjai trouver tous seul !!!! MAgnifique !!!:
Option Explicit
Sub Envoi_Mail()
Dim OutApp As Object, OutMail As Object, Fichier$, Fichier2$, i&
For i = 2 To Cells(Rows.Count, 1).End(xlUp).Row
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
Fichier = "D:\MON JOB\Facture\PDF\" & Cells(i, 1) & ".pdf"
Fichier2 = "D:\MON JOB\Facture\PDF\" & Cells(i, 2) & ".pdf"
On Error Resume Next
With OutMail
.To = Cells(i, 4)
.Subject = Cells(i, 5)
.Body = Cells(i, 6) & Chr(13) & _
"mon.job@hotmail.com"
.Attachments.Add Fichier
.Attachments.Add Fichier2
.Send 'Pour envoyer directement
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
Next
End Sub
PAR CONTRE AVEC .Send > j"ai un mesage de securite :OUTLOOK TENTE D'ENVOYER BLABLA ... je doit reclicker sur acceper comment eviter ca ?