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
| Sub Envoi_Client()
Dim MonOutlook As Object
Dim MonMessage As Object
ThisWorkbook.Sheets("Intrants").Select
Set MonOutlook = CreateObject("Outlook.Application")
Set MonMessage = MonOutlook.CreateItem(0)
MonMessage.To = Sheets("DONNEES_TECH").Range("Cou_Client").Value
MonMessage.Cc = Sheets("Data").Range("Message_Cc").Value
MonMessage.Subject = Range("Objet").Value
MonMessage.body = Range("Message_1") & _
Chr(13) & Chr(13) & Range("Message_2") & _
Chr(10) & Chr(10) & Range("Message_3") & _
Chr(10) & Chr(10) & Range("Message_4") & _
Chr(10) & Chr(10) & Range("Message_5") & _
Chr(10) & Chr(10) & Range("Message_6")
'Export en PDF
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=myFile _
, Quality:=xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas _
:=False, OpenAfterPublish:=False
MonMessage.Attachments.Add ActiveWorkbook.Path & "\" & ThisWorkbook.Name
MonMessage.display
Set MonOutlook = Nothing
End Sub |
Partager