ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Email work book. (https://www.excelbanter.com/excel-discussion-misc-queries/263707-email-work-book.html)

Melisa Hutchins

Email work book.
 
Hi
I have a work book or spread sheet, when filled out it must be sent to a supervisor for verification or approval, After approval it needs to be sent to another person. I want to be able to do this in vba code. The code I am currently using to send to one person is below. Can someone please help me?

Private Sub Workbook_BeforeClose(Cancel As Boolean)
Dim Mail_workbook_Outlook_1()
Dim OutApp As Object
Dim OutMail As Object

Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)

On Error Resume Next
With OutMail
.To = "
.CC = ""
.BCC = ""
.Subject = "Flagged Order"
.Body = "New Flagged Order"
.Attachments.Add ActiveWorkbook.FullName
.Send
End With
On Error GoTo 0

Set OutMail = Nothing
Set OutApp = Nothing
End Sub


All times are GMT +1. The time now is 11:27 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com