Sub mail()
' Nécessite la référence : Microsoft Outlook 1x Object Library
Dim olApp As Outlook.Application
Dim olMail As MailItem
Dim CurFile As String
Set olApp = New Outlook.Application
Set olMail = olApp.CreateItem(olMailItem)
CurFile = ThisWorkbook.Path & "\" & "Commande PHF.Pdf"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=CurFile, _
Quality:=xlQualityStandard, IncludeDocProperties:=False, IgnorePrintAreas:=False, _
OpenAfterPublish:=False
With olMail
.To = ""
.CC = ""
.Subject = "Commande PHF"
.Body = "Bonjour" & vbNewLine & "Ci-joint Bon de commande PHF" & vbNewLine & "Cordialement" & vbNewLine & ""
.Attachments.Add CurFile
.Display '.Send
End With
'MsgBox "Merci de vérifier que le message apparait dans -messages envoyés- dans votre messagerie OUTLOOK."
' Effacer les variables objets
Set olMail = Nothing
Set olApp = Nothing
End Sub