Dim olApp As Outlook.Application
Dim olMail As MailItem
Dim EnvoisA$, Objet$, Corp$, Mois$, NomPdf$, NomDoc$, Rep_Pdf$, Msg$, _
Rep_Doc$, Rep$, Chemin$, Lt$, CopieC$, AdressBCC$, Adr$, c As Range
Set olApp = New Outlook.Application
Set olMail = olApp.CreateItem(olMailItem)
Mois = LCase(Format(Date, "mmmm"))
If Left(Mois, 1) = "a" Or Left(Mois, 1) = "o" Then
Lt = "d'"
Objet = "Rapport du mois " & Lt & Mois
Corp = "Bonjour," & _
vbCrLf & vbCrLf & _
"ci-joint le rapport du mois " & Lt & Mois & " pour votre agence." & _
vbCrLf & vbCrLf & _
"Nous restons bien entendu à votre disposition pour tout renseignement complémentaire." & _
vbCrLf & vbCrLf & _
"Cordialement." & _
vbCrLf & vbCrLf & vbCrLf & _
"JoJo - Directeur Général"
Else
Lt = "de"
Objet = "Rapport du mois " & Lt & " " & Mois
Corp = "Bonjour," & _
vbCrLf & vbCrLf & _
"ci-joint le rapport du mois " & Lt & " " & Mois & " pour votre agence." & _
vbCrLf & vbCrLf & _
"Nous restons bien entendu à votre disposition pour tout renseignement complémentaire." & _
vbCrLf & vbCrLf & _
"Cordialement." & _
vbCrLf & vbCrLf & vbCrLf & _
"JoJo - Directeur Général"
End If
With olMail
.To = EnvoisA
.BCC = Mid(AdressBCC, 1, Len(AdressBCC) - 1)
.Subject = Objet
.Body = Corp
.Display
.Attachments.Add Chemin & NomPdf
'.Attachments.Add Rep & NomDoc
End With
Application.DisplayAlerts = False
Application.Wait (Now + TimeValue("00:00:10"))
olMail.Close olSave
olApp.Quit
Set olApp = Nothing
Set olMail = Nothing