Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- fname = "testFile.pdf"
- ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:=fname, Quality:=xlQualityStandard, IncludeDocProperties:=False, IgnorePrintAreas:=False, OpenAfterPublish:=False
- Dim OutApp As Object
- Dim OutMail As Object
- Call Open_Outlook
- On Error Resume Next
- Set OutApp = CreateObject("Outlook.Application")
- Set OutMail = OutApp.CreateItem(0)
- With OutMail
- .To = "myMail@my.me"
- .Body = "Body"
- .SendUsingAccount = OutApp.Session.Accounts.Item(1)
- .CC = ""
- .BCC = ""
- .Subject = "Subject"
- .Attachments.Add fname
- .Send
- End With
- Set OutMail = Nothing
- Set OutApp = Nothing
- On Error GoTo 0
- Kill fname
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement