Improve company productivity with a Business Account.Sign Up
ThisWorkbook.SaveCopyAs (Environ("temp") & "\" & ThisWorkbook.Name)
NewOutlookMail "Subject orf email", "INtro Body Text", "firstname.lastname@example.org", , , False, True, (Environ("temp") & "\" & ThisWorkbook.Name)
Kill (Environ("temp") & "\" & ThisWorkbook.Name)
Function NewOutlookMail(strSubject As String, strBody As String, Optional strTo As String, _
Optional strCC As String, Optional strBCC As String, Optional SendYN As Boolean = False, _
Optional AttachYN As Boolean = False, Optional Attach1 As String) As Boolean
Dim olkApp As Object
Set olkApp = CreateObject("outlook.application")
.To = strTo
' .replyto = "email@example.com"
If strCC <> "" Then .CC = strCC
If strBCC <> "" Then .BCC = strBCC
.Subject = strSubject
.body = strBody
If AttachYN And Attach1 <> "" Then .Attachments.Add Attach1
If SendYN Then
Open in new window
Activeworkbook.Sendmail "firstname.lastname@example.org", "here's the workbook"
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.