1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| Sub Envoi_CDO2()
Dim CdoMessage As Object
Dim Fichier As Variant
ChDir "C:\Documents and Settings\UserName\Mes documents\documpent.ptt"
Fichier = Application.GetOpenFilename("Fichiers PTT (*.ptt), *.ptt")
If Fichier = False Then Exit Sub
Set CdoMessage = CreateObject("CDO.Message")
With CdoMessage
.Subject = "Exemple"
.From = "test@wanadoo.fr"
.To = ""
.CC = ""
.BCC = ""
.TextBody = "Texte dans le corps de message"
.AddAttachment Fichier
.Send
End With
Set CdoMessage = Nothing
End Sub |
Partager