Arf
Il semble qu'il y ait problème sur le Forum pour longueurs de ligne / de code...
Je remets sans fioriture :
Option Explicit
Const FilePathDaily As String = 'I:\\MC_PROD\\Reports\\Daily\\'
Const MailTo As String = 'TheChief@xld.fr;
TheSubChief@xld.fr'
Const MailCC As String = 'TheAccounts@xld.fr;
TheStats@xld.fr;
TheCash@xld.fr'
' NB => Needs Refrerence to Microsoft Outlook XX.0 Object Library via VBA / Tools
Sub TheEmailViaOutLook() '@+Thierry
Dim TheOLapp As Outlook.Application, TheOLitem As Outlook.MailItem
Dim TheMessage As String
TheMessage = 'Good Morning,' & vbCrLf & vbCrLf & _
'= = = This is an automatic generated email = = =' & vbCrLf & vbCrLf & _
'Please find enclosed the Transactions Report for ' & Format(Date, 'DDDD') & ' ' & Format(Date, 'DD/MM/YYYY') & vbCrLf & _
'Best Regards' & vbCrLf & '@+Thierry' & vbCrLf & vbCrLf
Set TheOLapp = CreateObject('Outlook.Application')
Set TheOLitem = TheOLapp.CreateItem(OlMailItem)
With TheOLitem
.To = MailTo
.CC = MailCC
.Importance = olImportanceNormal
.Subject = 'Daily Transactions Summary Reports (' & Format(Date, 'YYYY-MM-DD') & ')'
.Body = TheMessage
.Attachments.Add FilePathDaily & 'TheFile-' & Format(Date, 'YYYY-MM-DD') & '.xls'
.Categories = 'Daily-Report'
.OriginatorDeliveryReportRequested = True
.ReadReceiptRequested = True
'.Send '