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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SendObject - Can't open the mail session

Status
Not open for further replies.

Jackie

MIS
Feb 9, 2000
148
US

I am using the SendObject method for the first time. Below is the line of code for which I get the error "...can't open the mail session".

I selected Outlook 98 Type Library and Microsfot Outlook Express under Tools/References.

I am able to use the "SendTo" feature in Word so I know that the MAPI is available.

What other items should I verifiy to execute outlook?

Thank you,
-jackie

DoCmd.SendObject acReport, "PM_Proj_Num", "RichTextFormat(*.rtf)", "jbg", "", "", "PM report", "Attached is the weekly PM STatus Report", False, ""
 
I would be inclined to try this without the trailing "", i.e:

Code:
DoCmd.SendObject acReport, "PM_Proj_Num", "RichTextFormat(*.rtf)", "jbg", "", "", "PM report", "Attached is the weekly PM STatus Report", False

Also, you shouldn't need to declare references to Outlook or Outlook Express, since SendObject just use's your PC's default MAPI mail client software. So you might want to "unreference" these two.

[pc2]
 
Thank you for responding.


I made the code change and ran it both with and without the references; still get the error.
 
If you open your mail client before running the sendobject code. For instance, before the sendobject code, type:
TaskID = Shell("C:\program files\Microsoft Office\Office\Outlook.exe", vbMaximizedFocus

That should open up the client before trying to send the object to it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top