Send email from Access - Outlook security pop-up comes up BEHIND other windows, and sometimes can't be "found" to click on it!

In an Access application, users can click a button to send an email to the person whose record they are currently viewing, sometimes with an automatically composed message. In some places, Access collects a group of people to generate emails for.  When Access tries to set up the email in Outlook, the infamous security warning pops up - where you have to click to allow access to Outlook for 1 minute, 5 minutes, etc.  The users are OK with this. However, on some users machines recently, the security warning seems to pop up BEHIND other windows, and at times the users can't find it at all! The result is that they can't  click on it, the emails don't get generated, and my database is "broken".

Is there some way to make the security warning pop up on TOP of everything? Isn't that what it is supposed to do?
Who is Participating?
Eric ShermanConnect With a Mentor Accountant/DeveloperCommented:
Actually, the way I handled this situation was to use the Redemption Outlook DLL which will bypass this security prompt.

Once you install the Redemption DLL you will simply pass the Outlook Message to Redemption to bypass the security promt.  This works like a charm.  I have a client that sends emails daily to hundreds of customers using this method.

See sample code below.

Function SendMessage(AttachmentPath, strSubject, strBody)
   Dim ObjOutlook As Outlook.Application
   Dim objOutlookMSG As Outlook.MailItem
   Dim objOutlookRecip As Outlook.Recipient
   Dim objOutlookAttach As Outlook.Attachment
   Dim objSafeMail As Object
' Create the Outlook session.
Set ObjOutlook = CreateObject("Outlook.Application")

' Create the message.
Set objOutlookMSG = ObjOutlook.CreateItem(olMailItem)

With objOutlookMSG

      ' Set the Subject, Body, and Importance of the message.
      .SUBJECT = strSubject
      .BODY = strBody & vbCrLf & vbCrLf
      .Importance = olImportanceHigh  'High importance

      ' Add attachments to the message.
      If Not IsMissing(AttachmentPath) Then
        Set objOutlookAttach = .Attachments.Add(AttachmentPath)
      End If

End With
 'Passes the Outlook Message to Redemption to Bypass security prompts.
 Set objSafeMail = CreateObject("Redemption.SafeMailItem")
 objSafeMail.Item = objOutlookMSG


   objSafeMail.Recipients.Add (strRecipAcct)

End Function

smackay4069Connect With a Mentor Commented:
Is it possible that the windows in access are setup to be pop up or modal, which would mean they always are on top or have the focus. Also why not get a utility called click yes which clicks the yes automatically after the specified time. This means they wont need to see the outlook window
Scott McDaniel (Microsoft Access MVP - EE MVE )Connect With a Mentor Infotrakker SoftwareCommented:
If you're going to distribute your application, remember that you'll need to purchase a license for Redemption ($199, I believe) ... not a bad price, but you can get 3rd party email libraries which do the same thing and more for less cost. If you need to interact with Outlook (like manipulate the Calendar, Appointments, etc) then Redemption is the way to go ...
Get 10% Off Your First Squarespace Website

Ready to showcase your work, publish content or promote your business online? With Squarespace’s award-winning templates and 24/7 customer service, getting started is simple. Head to and use offer code ‘EXPERTS’ to get 10% off your first purchase.

harfangConnect With a Mentor Commented:
Hello MicheleRobinson

Just a thought. Can't you activate Outlook when you send the mail? That way, the message would naturally be on top, since it always on top of Outlook itself. For example, if you can retreive the caption of the current Outlook session, use AppActivate. But there are many other ways to activate an application as well.

Wayne Taylor (webtubbs)Connect With a Mentor Commented:
Hi MicheleRobinson,

You might like to have a look at CDO which bypasses Outlook altogether :- http:/Q_21336007.html


MicheleRobinsonAuthor Commented:
Thanks for all the feedback! The forms in Access are neither pop-up nor modal, so that isn't it.  Also, the odd thing is that this has started to happen on some user's computers, but not for others.  Of course it seems to work just fine on mine.  I think I'll have to check out both this click yes thing and Redemption. However, I'm guessing that either one of them would have to be installed on every user's computer... And I'm not sure if the customer really wants to bypass the security.  I will check the code in the morning to see if there is any place where I don't actually activate Outlook - that could possibly be it.  I'll let you know tomorrow if it might be the case, though I'll still have to wait until Monday for the people with the problem to try out a solution, since I don't have a direct link to those particular PC's.
"... to those particular PC's", no, but you can try different working habits: Outlook open in the background, Outlook minimized to the toolbar, not opened at all, etc.

rockiroadsConnect With a Mentor Commented:
Go for the CDO version - as webtubbs as suggested

When u use CDO, you never get prompted for the Outlook security message

this is the solution I give always when one wants to get rid of the warning, only drawback is u have to know the smtp server. So if this is used on a PC not using your smtp server, you need to ensure that the user's smtp server is saved somewhere, like a config table. Then your code reads this table

MicheleRobinsonAuthor Commented:
I wasn't able to actually get rid of the problem - I couldn't put any new programs on every user's computer, and nothing else seems to work consistently - but then the problem isn't consistent on everyone's PC either.  Go ahead and split the points - everyone tried to offer something.  Thanks!
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.