Experts Exchange connects you with the people and services you need so you can get back to work.
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
This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.