A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Email work book.



 
 
Thread Tools Display Modes
  #1  
Old May 13th, 2010, 03:41 PM posted to microsoft.public.excel.misc
Melisa Hutchins
external usenet poster
 
Posts: 2
Default 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




--
Melisa Hutchins
 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 04:45 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.