Solved

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

Posted on 2016-11-06
17
66 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
  • 5
  • 5
  • 2
  • +3
17 Comments
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 41876284
try using Outlook Redemption
0
 
LVL 119

Expert Comment

by:Rey Obrero
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
 
LVL 119

Expert Comment

by:Rey Obrero
ID: 41876300
you can try  this  Click Yes
0
 
LVL 13

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 47

Expert Comment

by:Dale Fye (Access MVP)
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 119

Expert Comment

by:Rey Obrero
ID: 41876469
did you check the Click Yes ?
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 

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 119

Expert Comment

by:Rey Obrero
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 84
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 57
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 57
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 84

Assisted Solution

by:Scott McDaniel (Microsoft Access MVP - EE MVE )
Scott McDaniel (Microsoft Access MVP - EE MVE ) earned 150 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 47

Accepted Solution

by:
Dale Fye (Access MVP) earned 350 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

Complete VMware vSphere® ESX(i) & Hyper-V Backup

Capture your entire system, including the host, with patented disk imaging integrated with VMware VADP / Microsoft VSS and RCT. RTOs is as low as 15 seconds with Acronis Active Restore™. You can enjoy unlimited P2V/V2V migrations from any source (even from a different hypervisor)

Join & Write a Comment

It’s a strangely common occurrence that when you send someone their login details for a system, they can’t get in. This article will help you understand why it happens, and what you can do about it.
This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
What’s inside an Access Desktop Database. Will look at the basic interface, Navigation Pane (Database Container), Tables, Queries, Forms, Report, Macro’s, and VBA code.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

705 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

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now