Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DoCmd.SendObject Problem

Status
Not open for further replies.

ddevil

Technical User
Feb 14, 2006
49
0
0
US
I'm trying to send an email from Access using the code below, but when it's executed, the Internet Connection Wizard comes up. Outlook is our current email client, do you know why this would happen?

DoCmd.SendObject acSendNoObject, , , ToReceiver, , , "Test", "TestData", , False
 
Maybe Outlook EXPRESS is the default mail client on that system and not what you think it is?

To check open up Internet Explorerer.
On the Tools Menu select internet options.
Switch to the Programs tab.
For E-mail make sure the appropriate e-mail program is selected (presumably Microsoft Outlook).

The directions above are for Internet Explorer 7 but they are similar if not the same for version 6.
 
This was set correctly any other ideas?
 
Same place but the Connections tab instead... You probably want the option that says NEVER DIAL A CONNECTION.
 
No, that wasn't it either. Is their and add in or something that I need to do in Access?
 
I had been assuming you can send a message from Outlook without error.

Does Outlook send messages ok?
 
It should more or less just work... Although Outlook is likely to prompt you about another application trying to send mail.

Since you don't get the Internet Connection wizard when you open IE, my gut tells me that the default mail client is not Outlook. Are you absolutely sure it is set to Outlook and not Outlook Express?
 
I'm absolutely sure. I even followed the instructions from this site and when I click on the link to test it, Outlook opens. I've tried having outlook open when using the send object function and I still get the same results. I'm stumped. It has to be something with my machine. My next step is to have someone else test the button and see if it does the same thing for them. I'll let you know if I find out anything or if you have more ideas, that would be great. Thanks!
 
I am guessing here but under the file menu in Outlook is Work Offline checked? If so, if you select (uncheck it) does the message go away?
 
No, work off line, was not selected. It was unchecked.
 
When I test your line of code and substitute a literal string (e-mail address) for the ToReceiver variable, it opens an e-mail ready to be sent just fine.

If you want to send it without seeing it, you need to pass false for the edit parameter. That may be worth a shot to see if it works better. But honestly I am out of ideas why you would get that message.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top