?
Solved

What is best way to turn off security messages when using SendObject in Access 2016

Posted on 2016-11-06
17
Medium Priority
?
126 Views
Last Modified: 2016-11-07
I am using the SendObject method of MS Access 2016 to send email by placing the following code in an onclick event.

DoCmd.SendObject , , acFormatTXT, strTo, , , strSubject, "test", False

When using this method a Microsoft security message advises that a program is attempting to send an email which requires clicking a button to send the email.

What is the best way to avoid this error?  Note that I send emails which are text based, but I also need to send xls files generated from querries.

Thanks
0
Comment
Question by:pcalabria
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 5
  • 2
  • +3
17 Comments
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 41876284
try using Outlook Redemption
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 41876285
or this one vbMapi
0
 

Author Comment

by:pcalabria
ID: 41876292
Thanks Rey, I was hoping to find a solution that works with the SendObject method built into Access 2016 and that I would not need to replace SendObject with new code.

Do you, or does anyone, know of a way to turn the messages off in Access 2016, or a way to add code that turns off the messages?

Thanks
0
Threat Trends for MSPs to Watch

See the findings.
Despite its humble beginnings, phishing has come a long way since those first crudely constructed emails. Today, phishing sites can appear and disappear in the length of a coffee break, and it takes more than a little know-how to keep your clients secure.

 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 41876300
you can try  this  Click Yes
0
 
LVL 18

Expert Comment

by:John Tsioumpris
ID: 41876387
For sending emails through Access for years i am using the CDO solution...It has no nags what so ever except when it is unsuccessful and it allow everything needed
Check this post here
0
 
LVL 48

Expert Comment

by:Dale Fye
ID: 41876396
I have seen CDO used and inherited some VB Script that uses it, but I generally use vbMAPI when working in Access.
0
 

Author Comment

by:pcalabria
ID: 41876468
I need to be able to email reports and queries, as you can do with the SndObject method.

Does anyone know if the  CDOSYS.dll works with windows eight and windows ten?
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 41876469
did you check the Click Yes ?
0
 

Author Comment

by:pcalabria
ID: 41876477
Rey, I have tried clickyes in the past,  and the problem I remember was performance, but it did work.  My workstations have very slow hard drives.

I'm interested in CDO because I've been using CDO for that past 15 years in this application, but when I upgraded to Access 2016 the reference showed up as MISSING.

If I can get CDO working I may not need to change any other code.
0
 
LVL 120

Expert Comment

by:Rey Obrero (Capricorn1)
ID: 41876481
@pcalabria,
it would have been nice if you posted those information in your original post.
we would have not bothered offering you other options.

anyway, try this sample from my friend Leo
http://www.accessmvp.com/thedbguy/demos/cdoemail.asp
0
 
LVL 85
ID: 41876924
vbMAPI gets my vote. It's easy to use and is VERY simple to deploy (since there is nothing to deploy, everything needed is in the modules you include in your VBA code).

Beginning with Exchange 2007 (and compatible versions of Office), CDO was no longer deployed. Of course, many programs will install the libraries, but if you want to use CDO you MUST ensure your target platform has those libraries (and all it's dependencies) installed and configured properly. For my money (and time), it's just not worth the trouble when you can buy vbMAPI for 102 USD.
0
 

Author Comment

by:pcalabria
ID: 41876994
I'm sorry for the confusion, perhaps I oversimplified.

I have a mature MS-2000 application running on XP machines.  I am trying to get this app to run on a Windows 10 machine
running Access 2016.
When I attempted to load the program file I received the following message:
Your Microsoft access database contains a missing or broken reference to the CDO.DLL version 1.21 pop up

Next, I held the shift key and started and moved directly to the code.  In the references section I found:
MISSING CDO 1.21 Library

Below the reference table I was able to find a path to the missing file, which is:
CDO.DLL

Upon doing research (as per Scotts message above), I became very confused as it seems a though I would need another approach to send emails.

My code to send email includes more than 100 routines which needs to:
send text and html emails
be capable of attaching multiple files
multiple To:, CC:, and BCC addresses
Attach MS Access Queries
Attach MS Access Reports
Support a Pause to review option before sending

First, I first tried using the Docmd.SendObject built into acc2016 and this solved some of the problems, except that I can not get rid of the security messages.

Second I wrote code to use the Outlook Object Module, and was very successful sending emails.  I was even able to turn off the security messages, however I could not figure out how to send Native Access queries and reports.

So Third, I went back to the Docmd.SendObject code hoping I would find a way to turn off the messages, as I successfully did with the outlook object module.  

Rey quickly suggested Click Yes, Outlook Redemption, and VbMapi which all have possibilities, but I believe my problem would be more simply solved if I can just turn off those darn messages.

I found a couple articles on the web about tricking the DoCmd.SendObject command to surpress the message, and another selling a com file that they claim you can install and it will turn off the message, but I don't know anything about them or their sources, so I wanted t come back there to see what you guys suggest.  Many of  you like Rey, Dale, and Scott, have helped me time and time again for many years.  This is my "safe place" for finding new code and solutions.

So what's the consensus?   The code using the OOM does most of what I want but does not allow me to send tables and queries.  Is using SendObject the best, or should I scrap all of it at use vbMapi?

Thanks all
0
 
LVL 58
ID: 41877003
<<I was hoping to find a solution that works with the SendObject method built into Access 2016 and that I would not need to replace SendObject with new code.

Do you, or does anyone, know of a way to turn the messages off in Access 2016, or a way to add code that turns off the messages?>>

just to add my .02 cents and to answer the specific question, no, there is nothing in Access that will do this.  That's the way Outlook's object model security works.

You have two basic choices:

1. Use another method such as BLAT, CDO or vbSendMail (all free).   But with all, there is install issues to consider.

2. Use a 3rd party tool as has been said, such as redemption, click yes, or vbMapi.

 For years, I used vbSendMail, but switched to vbMapi.   Allowed me to do much more with Outlook.

That's about it.  This is just a recap of everything that has already been said (and another vote for vbMapi) so no points here please.

Jim.
0
 
LVL 58
ID: 41877007
<<but I believe my problem would be more simply solved if I can just turn off those darn messages.>>

 You can't.

<< Is using SendObject the best, or should I scrap all of it at use vbMapi?>>

 I'd use vbMapi   It's the simplest of all of them, and I believe the cheapest as well.

Jim.
0
 
LVL 85

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 600 total points
ID: 41877076
Turning off those darn messages will work ... until MSFT changes the security model of Outlook again, which means you're back at square one.

As far as attaching files - any method outside of SendObject will require a re-work, since you'll have to introduce code to export your files to the desired format (PDF, CSV, etc) and then attach that external file to your email. None of the external methods (vbMAPI included) allow you to attach a file as easily as SendObject does in Access.

Also, my post above indicates the price is 102. That's wrong - as of now, it's 120 (sorry for the fat fingers).
0
 
LVL 48

Accepted Solution

by:
Dale Fye earned 1400 total points
ID: 41877105
If you were able to automate Outlook, but had problems with sending Access reports and query results, then the next step would be to use doCmd.OutputTo output the query results to Excel format and the reports to a PDF format, then you can continue to automate outlook to append those objects to the Outlook mail item.
0
 

Author Closing Comment

by:pcalabria
ID: 41878022
Thanks everyone.

I would up writing a sub program using the Outlook Object Module to send emails.  It was pretty easy to turn off the security warnings by starting outlook in administrator mode.

The problem was that I could not send reports and queries directly with the OOM.  Scott, you gave me the idea to integrate code to attach a the objects in my subroutine, but I was spinning my wheels until Dale mentioned the OutputTo method, which I had not used before.

I still have some issues, but for the most part I was able to work most of them through.  

Thanks again, you guys are awesome!
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Check out what's been happening in the Experts Exchange community.
With so many activities to perform, Exchange administrators are always busy in organizations. If everything, including Exchange Servers, Outlook clients, and Office 365 accounts work without any issues, they can sit and relax. But unfortunately, it…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question