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
| Sub EMail_Outlook_fichier_PDF()
Dim OutApp As Object
Dim OutMail As Object
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
Dim sh As Worksheet
Set sh = Sheets("Contrat")
chemin = "Z:\Mariage\MANOIR DES LYS" 'à adapter
fichier = ".pdf" 'à adapter
sh.ExportAsFixedFormat Type:=xlTypePDF, Filename:=chemin & fichier, Quality:= _
xlQualityStandard, IncludeDocProperties:=True, IgnorePrintAreas:=False, OpenAfterPublish:=False
With OutMail
.To = Sheets("Contrat").Range("D10").Value
.CC = ""
.BCC = ""
.Subject = "Manoir des Lys : Contrat/Devis"
.Body = ""
.Attachments.Add chemin & fichier
.Display
' .Send
End With
Set OutMail = Nothing
Set OutApp = Nothing
Kill chemin & fichier
End Sub |
Partager