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 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60
| Sub Mail()
Dim destinataire1, destinataire2, destinataire3, destinataire4, destinataire5, cc, body, sujet, strcommand, fichierjoint As String
destinataire1 = "michel.tato@xxx.fr,sophie.dodu@xxx.fr"
destinataire2 = "patrick.momi@xxx.fr"
destinataire3 = "xavier.bibo@xxx.fr,philippe.sese@xxx.fr"
destinataire4 = "perrine.popi@xxx.fr"
destinataire5 = "catherine.baba@xxx.fr,regis.muta@xxx.fr"
cc = "controle@xxx.fr"
chemin = "G:\XXX\YYY\...\ZZZ\"
Repertoire = [A9].Value & "\"
Fichier3 = Sheets("Feuil2").[E1].Value & ".xlsm"
fichierjoint = chemin & Repertoire & Fichier3
If [A9].Value = "AA" Then
sujet = "Fiche anomalie"
body = "<HTML><BODY>Bonjour" & "," & "<br>" & "<br>" & "Nous vous prions de trouver ci-joint" & ", " & _
"une fiche anomalie concernant la saisie d'un opérateur de votre service." & _
" Nous vous remercions de lui transmettre ladite fiche et de lui demander de régulariser le dossier dans les meilleurs délais." & _
"<br>" & "<br>" & "<br>" & "Bien cordialement." & "<br>" & "<br>" & "<br>" & "<br>" & "Le Service Contrôle.</BODY></HTML>"
strcommand = "C:\Program Files\Mozilla Thunderbird\thunderbird"
strcommand = strcommand & " -compose " & "to='" & destinataire1 & "'"
strcommand = strcommand & "," & "cc='" & cc & "'"
strcommand = strcommand & "," & "subject='" & sujet & "',format='1',"
strcommand = strcommand & "body='" & body & "'"
strcommand = strcommand & "," & "attachment='file:///" & fichierjoint & "'"
Call Shell(strcommand, vbNormalFocus)
End If
If [A9].Value = "BB" Then
sujet = "Fiche anomalie"
body = "<HTML><BODY>Bonjour" & "," & "<br>" & "<br>" & "Nous vous prions de trouver ci-joint" & ", " & _
"une fiche anomalie concernant la saisie d'un opérateur de votre service." & _
" Nous vous remercions de lui transmettre ladite fiche et de lui demander de régulariser le dossier dans les meilleurs délais." & _
"<br>" & "<br>" & "<br>" & "Bien cordialement." & "<br>" & "<br>" & "<br>" & "<br>" & "Le Service Contrôle.</BODY></HTML>"
strcommand = "C:\Program Files\Mozilla Thunderbird\thunderbird"
strcommand = strcommand & " -compose " & "to='" & destinataire2 & "'"
strcommand = strcommand & "," & "cc='" & cc & "'"
strcommand = strcommand & "," & "subject='" & sujet & "',format='1',"
strcommand = strcommand & "body='" & body & "'"
strcommand = strcommand & "," & "attachment='file:///" & fichierjoint & "'"
Call Shell(strcommand, vbNormalFocus)
End If
End Sub |
Partager