Sub
Test()
Range(
"n6"
).Value = Time
Range(
"N1"
).Value = Environ(
"Username"
)
Dim
DateiName
As
String
DateiName = Range(
"K3"
) & Range(
"K2"
) &
".pdf"
Range(
"A1:j57"
).ExportAsFixedFormat Type:=xlTypePDF, Filename:=
"R:\Test.pdf"
, OpenAfterPublish:=
False
Dim
Outlook
As
Object
Dim
OutlookMailItem
As
Object
Dim
myAttachments
As
Object
Set
OutlookApp = CreateObject(
"Outlook.Application"
)
Set
OutlookMailItem = OutlookApp.CreateItem(olMailItem)
Set
myAttachments = OutlookMailItem.Attachments
With
OutlookMailItem
.Display
.to = Range(
"S2"
).Value
.Subject = Range(
"S3"
).Value
myAttachments.Add
"R:\Test.pdf"
.Display
End
With
Set
OutlookApp =
Nothing
Set
OutlookMail =
Nothing
End
Sub