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

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
LVL 8
Rance_HallAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

dannywarehamCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Can you provide the exact text of the error, along with the error number?
0
Rance_HallAuthor Commented:
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
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
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
Rance_HallAuthor Commented:
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
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
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
Rance_HallAuthor Commented:
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
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
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
Rance_HallAuthor Commented:
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
dannywarehamCommented:
You can use KILL to delete a file.

KILL filelocationname
0
Rance_HallAuthor Commented:
cool, thanks alot.

0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Access

From novice to tech pro — start learning today.

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.