Results 1 to 10 of 10

Send Email with MsgBox vbOk

Threaded View

  1. #1
    Forum Expert Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,787

    Send Email with MsgBox vbOk

    Hi all,

    I have a message box with OK and Cancel. I need to have Excel send an email if the user presses ok or to not send if the user presses cancel. I have the code to send emails but I don't know how to apply it to a message box vbOk. I tried the following:
    If vbOK Then
            ActiveWorkbook.SendMail _
                Recipients:="mvasas@hydro.mb.ca", _
                Subject:="IPI Charting Tool Feedback " & Format(Date, "dd/mmm/yy")
            Else
                Exit Sub
            End If
    but this runs the sendmail no matter which button I press. Please help.

    Regards:
    Last edited by Mordred; 06-16-2011 at 05:24 PM.
    If you're happy with someone's help, click that little star at the bottom left of their post to give them Reps.

    ---Keep on Coding in the Free World---

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