Get rid of warning when using DoCmd.SendObject acSendNoObject

Get rid of warning when using DoCmd.SendObject acSendNoObject
Who is Participating?
Jeffrey CoachmanMIS LiasonCommented:
Just throwing this out there...
...just for curiosity sake
...a bit heavy-handed, ...but you could create the email with outlook specific code.
(and add a reference to the Outlook Library in VbA)
...not sure if this works in the most recent versions of Access though...

roughly like this fairly popular code:
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim objOutlookAttach As Outlook.Attachment

Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

        With objOutlookMsg
            Set objOutlookRecip = .Recipients.Add("")
            objOutlookRecip.Type = olTo
            .Subject = "Your Subject"
            .Body = "Your Body text"
        End With
    End If

Set objOutlookMsg = Nothing
Set objOutlook = Nothing

Open in new window

The full code can be found here (with more options)
[ fanpages ]IT Services ConsultantCommented:
If the warning you refer to is generated by MS-Access, then...

Call DoCmd.SetWarnings(WarningsOn:=False) ' or, DoCmd.SetWarnings False

        DoCmd.SendObject acSendNoObject

Call DoCmd.SetWarnings(WarningsOn:=True) ' or, DoCmd.SetWarnings True

However, I suspect you may have meant a warning generated by your e-mail client (MS-Outlook, for instance).

Is that the case?
deer777Author Commented:
I tried set warnings false but that does not get rid of the prompt to allow or deny sending the email
Even tried DoCmd.SendObject acSendNoObject, , , False, False
That did not deter the allow or deny warning either
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
As fanpages mentioned, if the alert is coming from your email client you'll have to take other measures.

Some have reported success with ClickYes: I've never tried it, so cannot give you any firsthand reviews.

If you want real control over your Access email I'd recommend vbMAPI: It is the easiest way to work with Outlook, and is very easy to deploy (no external references to deploy, everything is contained in a handful of class modules).
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.