LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 78
Default Auto notify a list of people via email when excel file is closed

I have five columns...one called "action required" and under this column I
have a drop down that has four options "n/a" , "Grp1" , "Grp2", "Grp3" I
would input the data....choose "Grp1".....what I want to happen is when I
choose "Grp1" and close the file an email notification to be sent to 2
people. But when I choose "Grp2" and close the file an email notification
will be sent to 3 different people. And when I choose "Grp3" and close the
file a different group of people will be sent an email notification. When I
choose "n/a" no notification will be sent. How do I this?

What I have done so far (which isn't much)....

I have this macro (see below) that when you close the file a pop-up box
appears that ask you if you want to send an email notification to a list of
people saying that you've made an update to the file.

Macro:
Private Sub Workbook_BeforeClose(Cancel As Boolean)

'define variables
Dim answer As String

'get user action
answer = MsgBox("Send update notice?", vbYesNo, "Confirmation")

'if user wants to send update, send; otherwise just close the document
If answer = vbYes Then
'open outlook type stuff
Set OutlookApp = CreateObject("Outlook.Application")
Set OlObjects = OutlookApp.GetNamespace("MAPI")
Set newmsg = OutlookApp.CreateItem(olMailItem)
'add recipients
'newmsg.Recipients.Add ("Melanie Hauser")
newmsg.Recipients.Add ("Liz Withnell")
newmsg.Recipients.Add ("Pat Myer")
newmsg.Recipients.Add ("Linda Burnim")
'add subject
newmsg.Subject = "Configurator Spreadsheet Update"
'add body
newmsg.Body = "The configurator spreadsheet has been modified."
newmsg.Display 'display
newmsg.Send 'send message
'give conformation of sent message
MsgBox "Update notice has been sent.", , "Confirmation"
ElseIf answer = vbNo Then
'give conformation of no sent message
MsgBox "No notice has been sent.", , "Confirmation"
End If

'save the document
'Me.Worksheets.Save

End Sub

Please help!

Melanie
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
excel - Taking a list of people and adding them to 2 columns ycwkpp898 Excel Discussion (Misc queries) 0 August 5th 08 02:44 PM
How to send email to a list of people in excel sheet? David Excel Discussion (Misc queries) 1 December 14th 06 12:46 AM
How does the excel file update e-mail notify work? Gatekeeper Excel Worksheet Functions 0 June 30th 06 11:56 AM
how do you turn an email address list into an Excel csv or txt file? Weber1 Excel Worksheet Functions 5 May 8th 06 04:10 PM
Send Email from Excel - but only to people in range Steve[_57_] Excel Programming 3 February 8th 04 05:56 AM


All times are GMT +1. The time now is 08:50 AM.

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

About Us

"It's about Microsoft Excel"