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
806 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
 
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
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

 
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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Join & Write a Comment

Get an idea of what you should include in an email disclaimer with these Top 5 email disclaimer tips.
Follow this checklist to learn more about the 15 things you should never include in an email signature from personal quotes, animated gifs and out-of-date marketing content.
In Microsoft Access, learn how to “cascade” or have the displayed data of one combo control depend upon what’s entered in another. Base the dependent combo on a query for its row source: Add a reference to the first combo on the form as criteria i…
Using Microsoft Access, learn some simple rules for how to construct tables in a relational database. Split up all multi-value fields into single values: Split up fields that belong to other things into separate tables: Make sure that all record…

707 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

11 Experts available now in Live!

Get 1:1 Help Now