.
Paste in a Routine Module, run with Command Button :
Option Explicit
Sub Mail_workbook_Outlook()
Dim OutApp As Object
Dim OutMail As Object
Dim sndEmail As String
Dim ccEmail As String
Dim bccEmail As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
toEmail = Sheets("EMAIL").Range("D2").Value
ccEmail = Sheets("EMAIL").Range("D3").Value
bccEmail = Sheets("EMAIL").Range("D4").Value
On Error Resume Next
With OutMail
.To = sndEmail
.CC = ccEmail
.BCC = bccEmail
.Subject = "Spare Parts Maintenance"
.Body = "The parts have been placed on today's load sheet and will be processed by EOB today. The parts have also been transferred to the repository file."
.Attachments.Add (Application.ActiveWorkbook.FullName) 'attaches this workbook to email
'.Send '<-- .Send will auto send email without review
.Display '<-- .Display will show the email first for review
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Bookmarks