Turning ".Send" method OFF

  • I have some code:

    With olMail
                        .To = FullDetail
                        .HTMLBody = NameHtml & ", " & .HTMLBody
                        .Attachments.Add SourceFile
                        .Attachments.Add PcnFile
                    End With

    After e-mail is sending I would like to turn ".Send" method OFF (to avoid automatically e-mails sending)

    Is anyway to do it?

  • Re: Turning ".Send" method OFF

    why don't you just add a msg box to prompt user that they are about to send an email and give them an oppurtunity to cancel out.

    something like this

    sub sendmail ()
        If MsgBox("You are about to email all sheets, Do you want to proceed?", _
            vbYesNo, "Send?") = vbYes Then
    ' your mail code here
           MsgBox "Email(s) have been sent!!"
            MsgBox "Email(s) have not been sent!!"
        End If
    end sub

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!