Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
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
Medium Priority
?
813 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 500 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 85
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
NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

 
LVL 85
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 85
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 85
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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

This article shows how to get a list of available printers for display in a drop-down list, and then to use the selected printer to print an Access report or a Word document filled with Access data, using different syntax as needed for working with …
Instead of error trapping or hard-coding for non-updateable fields when using QODBC, let VBA automatically disable them when forms open. This way, users can view but not change the data. Part 1 explained how to use schema tables to do this. Part 2 h…
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.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

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