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
|
Sub Send()
Dim strRetourInput As String
strRetourInput = InputBox("Saisir le numéro de fax:", "Numéro fax:", "")
If strRetourInput = "" Then
MsgBox "Action annulée par l'utilisateur ou bien aucune saisie de l'utilisateur."
End If
Dim olApp As Outlook.Application
Dim objMail As Outlook.MailItem
Set olApp = Outlook.Application
Set objMail = olApp.CreateItem(olMailItem)
Dim FichierJoint As Outlook.Attachments
Set FichierJoint = objMail.Attachments
fichier = "C:\dossier1\fichier1.xls"
FichierJoint.Add fichier, olByValue, 1, ""
With objMail
.BodyFormat = olFormatPlain
.Subject = "Fax"
.Body = "xxxxxx"
.To = strRetourInput + "@fax.xxxx.fr"
.Display
End With
End Sub |
Partager