Bonjour à tous,
J'ai une macro Sous Excel qui me permet de parcourir un fichier et d'envoyer des emails personnalisés à chaque personne de ma liste.
J'ai donc le nom de la personne dans la colonne C de mon fichier et son adresse email dans la colonne D.
Mon problème est qu'à chaque envoi, Outlook me demande une confirmation. J'ai lu pas mal de sujets mais je n'ai pas réussi à trouver un sujet qui règle le problème sans avoir à télécharger des logiciels que je ne peux pas télécharger depuis mon boulot.
Quelqu'un aurait une solution svp?
Mon code est le suivant:
Merci beaucoup d'avance !
Code : Sélectionner tout - Visualiser dans une fenêtre à part
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 Sub sumit() Dim mainWB As Workbook Dim SendID Dim CCID Dim Subject Dim Body Dim olMail As MailItem For i = 1 To 3 Set otlApp = CreateObject("Outlook.Application") Set olMail = otlApp.CreateItem(olMailItem) Subject = "Sujet du message" With olMail .To = Sheets(1).Range("D" & i).Value .Attachments.Add "P:\Bureau\Mails de voeux\imageBlason.jpg" .Attachments.Add "P:\Bureau\Mails de voeux\imageVideo.jpg" .Subject = Subject .HTMLBody = .HTMLBody _ & "<body bgcolor=white lang=FR link=blue vlink=purple><div class=WordSection1><p class=MsoNormal><span lang=EN-GB style='font-size:11.0pt'><o:p> </o:p></span></p><div align=center><table class=MsoTableGrid border=1 cellspacing=0 cellpadding=0 width=619 style='width:464.1pt;background:white;border-collapse:collapse;border:none'><tr style='height:4.0cm'><td width=619 valign=top style='width:464.1pt;border:solid #002060 1.0pt;border-bottom:none;padding:1.0cm 1.0cm 1.0cm 1.0cm;height:4.0cm'><p align=center style='margin-bottom:0cm;margin-bottom:.0001pt;text-align:center;line-height:150%'><b><span style='font-size:11.0pt;line-height:150%;font-family:'Georgia','serif''><img src='cid:imageBlason.jpg'></span></b><strong><span lang=EN style='font-size:11.0pt;line-height:150%;font-family:'Georgia','serif';mso-fareast-language:FR'><o:p></o:p></span></strong></p></td></tr><tr style='height:4.0cm'>" _ & "<td width=619 valign=top style='width:464.1pt;border-top:none;border-left:solid #002060 1.0pt;border-bottom:none;border-right:solid #002060 1.0pt;padding:1.0cm 1.0cm 14.2pt 1.0cm;height:4.0cm'><p style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:150%'><strong><span lang=EN style='font-size:11.0pt;line-height:150%;font-family:'Georgia','serif';color:#4D4D4D;mso-fareast-language:FR;font-weight:normal'><font style='color:#000030;'><B>Dear " & Sheets(1).Range("C" & i).Value & " </B></span></strong><b><span lang=EN style='font-size:11.0pt;line-height:150%;font-family:'Georgia','serif';color:#4D4D4D;mso-fareast-language:FR'> </span></b><span lang=EN style='font-size:11.0pt;line-height:150%;font-family:'Georgia','serif';color:#4D4D4D;mso-fareast-language:FR'><br><br>texte<br><br>" _ & "</font></span><span lang=EN-GB style='color:#4D4D4D;mso-fareast-language:FR'><o:p></o:p></span></p></td></tr><tr style='height:1.0cm'><td width=619 valign=top style='width:464.1pt;border-top:none;border-left:solid #002060 1.0pt;border-bottom:none;border-right:solid #002060 1.0pt;padding:0cm 1.0cm 14.2pt 1.0cm;height:1.0cm'><p><span lang=EN style='font-size:12.0pt;font-family:'Georgia','serif';color:#002855;mso-fareast-language:FR'><font style='color:#000030;'>Signature</font><strong><span style='font-family:'Georgia','serif''><o:p></o:p></span></strong></span></p></td></tr><tr style='height:1.0cm'><td width=619 valign=top style='width:464.1pt;border-top:none;border-left:solid #002060 1.0pt;border-bottom:none;border-right:solid #002060 1.0pt;padding:0cm 0cm 0cm 0cm;height:1.0cm'>" _ & "<p align=center style='margin-bottom:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'><a href='http://excel.developpez.com'><span style='font-size:12.0pt;font-family:'Georgia','serif';color:#004179;text-decoration:none'><img src='cid:imageVideo.jpg'></span></a><span lang=EN-GB style='font-size:12.0pt;font-family:'Georgia','serif';color:#004179;mso-fareast-language:FR'><o:p></o:p></span></p></td></tr><tr style='height:1.0cm'><td width=619 valign=top style='width:464.1pt;border:solid #002060 1.0pt;border-top:none;padding:0cm 1.0cm 0cm 1.0cm;height:1.0cm'><p style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal'><span lang=EN-GB style='font-size:7.0pt;font-family:'Georgia','serif';color:#4D4D4D;mso-fareast-language:FR'><o:p> </o:p></span></p><p style='margin-bottom:0cm;margin-bottom:.0001pt;line-height:normal'>" _ & "<span lang=EN-GB style='font-size:7.0pt;font-family:'Georgia','serif';color:#4D4D4D;mso-fareast-language:FR'><o:p> </o:p></span></p><p align=center style='margin-bottom:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'><i><span lang=EN-GB style='font-size:7.0pt;font-family:'Georgia','serif';color:#4D4D4D;mso-fareast-language:FR'>Si le message ci-dessus ne s'affiche pas correctement, vous pouvez le visualiser dans votre navigateur <a href='http://www.edmond-de-rothschild.com/site/International/fr/voeux/2017'><span lang=FR>en cliquant ici</span></a>.</span></i><span lang=EN-GB style='font-size:8.0pt;mso-fareast-language:FR'><o:p></o:p></span></p><p align=center style='margin-bottom:0cm;margin-bottom:.0001pt;text-align:center;line-height:normal'><span lang=EN-GB style='mso-fareast-language:FR'><o:p> </o:p></span></p></td></tr></table></div><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal><o:p> </o:p></p><p class=MsoNormal>" _ & "<o:p> </o:p></p></div></body>" .Send End With Next i End Sub
Yann
Partager