Solved

when sending reports from access 2007 with the "sendObject" method a run-time error is generated saying that the message can not be sent.

Posted on 2008-10-16
11
809 Views
Last Modified: 2012-05-05
Ive been reading on this all morning, and it appears the problem is related to an outlook security fix that broke stuff.

if I read correctly then there is a registry change that can fix outlook so that it CAN accept messages from access and will display the message box "A program is trying to send email on your behalf, do you want to allow this?"

I have installed "Click Yes" so I can handle the message, but I need to get my situation to a point where the message warning box actually comes up.

Can someone help me with the registry change to allow this?

Thanks
0
Comment
Question by:Rance_Hall
  • 5
  • 4
  • 2
11 Comments
 
LVL 26

Accepted Solution

by:
dannywareham earned 125 total points
ID: 22736231
I don't know about a registry fix - but this is a long standing issue with interoperabiity with outlook.
You can use Outlook redmeption or SMTP to get round it.
I can get you links if you wish (or search it here - there's shed loads on Redemption).
0
 
LVL 84
ID: 22739100
Can you provide the exact text of the error, along with the error number?
0
 
LVL 8

Author Comment

by:Rance_Hall
ID: 22740785
Exact text of the error message box is:

Run-time error '2293':

Microsoft Office Access can't send this e-mail message.


<-End error message box->

Strange thing is that the dev box can send the email no problem.

but when the code is deployed it stops working, which means that there is something different about the two systems.

According to install history, all the same service packs and critical fixes are installed on both boxes.

according to regedit the key difference between the two boxes is that the dev box has had older versions of outlook installed in the past and it still has the regkeys for those.

the offending box is new enough to not have seen an older version of outlook.

Which leads me to conclude that its a "simple" registry hack.  Simple if you know which one that is.

0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 
LVL 84
ID: 22740923
Do you have a Reference set to Outlook in your application?

I know of no registry hack for this, and I've been working with this type of system for many, many years ...
0
 
LVL 8

Author Comment

by:Rance_Hall
ID: 22740996
Here is a code snippet that is run just before the various sendObject commands:

varRetVal = Shell("C:\Program Files\Microsoft Office\Office12\outlook.exe")

varRetVal = Shell("C:\Program Files\Express ClickYes\ClickYes.exe")

'grab clickyes
uClickYes = RegisterWindowMessage("CLICKYES_SUSPEND_RESUME")

wnd = FindWindow("EXCLICKYES_WND", 0&)

'turn clickyes on
Res = sendmessage(wnd, uClickYes, 1, 0)
0
 
LVL 84
ID: 22741055
That's an odd method to use ... can't say I've seen that one before in my 10+ years of coding. Why are you using Shell to open Outlook? SendObject will use whatever is the default email client and will open it if needed ... ClickYes can be opened and initialized immediately before the SendObject call ...

Are you sure the path to Outlook and ClickYes is correct?
0
 
LVL 8

Author Comment

by:Rance_Hall
ID: 22747837
Yea, the paths are correct.

The reason for opening outlook via a shell is that sometimes the message would go to the outbox but not actually get sent till after outlook was started manually.

The fix admittedly could be more elegant (check if outlook is running, if not start it)

but for what we were doing it was OK.
0
 
LVL 84
ID: 22747931
If your app relies on email, then to me the fix is to not use Outlook at all, but instead use CDO, vbSendMail or a 3rd party control to do this.

If you remove the Shell items and just issue a Sendobject command, do you get the error? If so, then perhaps add a the ClickYes line and test ... then add another line ... etc.

Also: Can you list your references here? You say that it works fine on the dev machine but not an enduser box ... perhaps it's a reference issue?

0
 
LVL 8

Author Comment

by:Rance_Hall
ID: 22761988
ok gang, based on some advice here, Ive scrapped docmd.sendobject all together.

I have modified my code to use docmd.outputto instead.

I have created a set of *.pdf files and one *.xls file and am using blat for windows as a command line smtp mailer and its working quite well.

Just a couple of clean up questions and then I think I can close this.

I want to delete the temp files I just created.

so issued a shell command "del /q c:\temp\*.pdf

and got a run-time error '53'
"File Not Found"

and the only thing I could think of was that "DEL" is not in the path or whatever and I'm going to need to supply the WHOLE path to DEL.

only problem with that was I can find where DEL is supposed to be installed.

anybody seen this before?
0
 
LVL 26

Expert Comment

by:dannywareham
ID: 22762013
You can use KILL to delete a file.

KILL filelocationname
0
 
LVL 8

Author Comment

by:Rance_Hall
ID: 22767182
cool, thanks alot.

0

Featured Post

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Suggested Solutions

Are you unable to connect or configure Hotmail email account in Microsoft Outlook 2010, 2007? Or Outlook.com emails are not downloading to Outlook? Lets’ see the problem and resolve Outlook Connector error syncing folder hierarchy (0x8004102A).
When you have clients or friends from around the world, it becomes a challenge to arrange a meeting or effectively manage your time. This is where Outlook's capability to show 2 time zones in one calendar comes in handy.
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…
CodeTwo Sync for iCloud (http://www.codetwo.com/sync-for-icloud?sts=6554) automatically synchronizes your Outlook 2016, 2013, 2010 or 2007 folders with iCloud folders available via iCloud Control Panel. This lets you automatically sync them with…

803 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