+ Reply to Thread
Results 1 to 2 of 2

Email message sent on save

  1. #1
    Registered User
    Join Date
    11-20-2012
    Location
    Des Moines, IA
    MS-Off Ver
    Excel 2010
    Posts
    8

    Email message sent on save

    I created a spreadsheet a few months back. It went from just one person using it, to 3 people. The spreadsheet lives in the network on the people using it asked me to add a feature to it. I looked in the forum for something similar, but couldn't find anything. Maybe my search criteria was off. Anyway...

    The ladies who use it would like it to generate an email to the group (3 static email addresses) when saved. I'm not sure the goal, but I said I would look into it. Is something like that possible?

  2. #2
    Registered User
    Join Date
    11-20-2012
    Location
    Des Moines, IA
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Email message sent on save

    I was reading up on other posts and found something that seemed plausable. It didn't do anything on save tho.. Any advice?

    Private Sub Workbook_BeforeSave(ByVal SaveAsUI As Boolean, _
    Cancel As Boolean)

    Dim answer As String

    answer = MsgBox("Do you want to save?", vbYesNo, "Save")

    If answer = vbNo Then Cancel = True
    If answer = vbYes Then

    Set OutlookApp = CreateObject("Outlook.Application")
    Set OlObjects = OutlookApp.GetNamespace("MAPI")
    Set newmsg = OutlookApp.CreateItem(olMailItem)
    newmsg.Recipients.Add ("matt@mysef.com")

    newmsg.Subject = "Project Tracking Form Was Saved"
    newmsg.Body = "Just an FYI"
    newmsg.Display
    newmsg.Send
    MsgBox "insert confirmation box test here", , "title of confirmation box"


    End If

    Me.Worksheets.Save

    End Sub

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1