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
811 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
[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
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Access developers frequently have requirements to interact with Excel (import from or output to) in their applications.  You might be able to accomplish this with the TransferSpreadsheet and OutputTo methods, but in this series of articles I will di…
This article describes how to import an Outlook PST file to Office 365 using a third party product to avoid Microsoft's Azure command line tool, saving you time.
In Microsoft Access, learn the trick to repeating sub-report headings at the top of each page. The problem with sub-reports and headings: Add a dummy group to the sub report using the expression =1: Set the “Repeat Section” property of the dummy…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

739 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