Sub
PDF()
ChDir
"H:\Desktop"
ActiveSheet.ExportAsFixedFormat Type:=x1TypePDF, Filename:= _
"H:\Desktop\Lieferschein.pdf"
, OpenAfterPublish:=
True
Dim
Outlook
As
Object
Dim
OutlookMailItem
As
Object
Dim
myAttachments
As
Object
Set
OutlookApp = CreateObject(
"outlook.application"
)
Set
OutlookMailItem = OutlookApp.CreateItem(0)
Set
myAttachments = OutlookMailItem.Attachments
With
OutlookMailItem
.to =
"Random@312.de"
.Subject =
"Lieferschein"
.Body =
"Sehr geehrte Damen und Herren,"
myAttachments.Add
"H:\Desktop\Lieferschein.pdf"
.Display
End
With
Set
OutlookApp =
Nothing
Set
OutlookMailItem =
Nothing
End
Sub