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 = Sheets("Bon de commande").Range("B7").Value
.CC = "valerie.masson@renault.com;jean-paul.masson@renault.com"
.Subject = "Commande PHF"
[COLOR=rgb(184, 49, 47)].Body = "Bonjour" & vbNewLine & "Ci-joint Bon de commande PHF" & vbNewLine & "Cordialement" & vbNewLine & "" & "<a href="mailto:test@sfr.fr"> transfert pour accord </a>"[/COLOR]
.Body = Replace(.Body, vbNewLine, "<BR>")
.BodyFormat = 2
.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