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
| Sub envoi_mail()
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Dim olFormatHTML As String
MsgBox ("Préparation du MAIL D'INFORMATION AUX UTILISATEURS DE LA MAIN COURANTE. " & Chr(10) & Chr(10) & "la fenêtre du message va s'afficher" & Chr(10) & "Merci de valider l'envoi")
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
*strbody = "Information sur la mise à jour"
On Error Resume Next
* * With OutMail
* * * * .To = "Administrateur@organisme.fr"
* * * * .CC = "Toto@yahoo.fr; <!-- e --><a href="mailto:titi@yahoo.fr">titi@yahoo.fr</a><!-- e -->"
* * * * .BCC = ""
* * * * .Subject = "Mise à jour de la main courante"
* * * * .BodyFormat = olFormatHTML
* * * .HTMLBody = "Bonjour, <BR><BR>Ce message est un mail automatique, il vous informe que " & Environ("username") & " a mis à jour la main courante.<BR><BR>" _
* * * * & "<A href=" & """" & "\\Nom_serveur\Repertoire\nom_ficihier.xls" & """" & ">Accéder à la main courante.</A>" & Chr(10) & "<BR><BR>Cordialement"
* * * * .Display
* * End With
* * * * On Error GoTo 0
*
* * Set OutMail = Nothing
* * Set OutApp = Nothing
End Sub |
Partager