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

acSendObject not sending email

Status
Not open for further replies.

blindlemonray

Technical User
Nov 24, 2003
130
GB
Hi All,

I am trying to send emails via Access but when i run my code the email opens puts in all the correct details, attaches the report but stops short of actually sending the email. I still have to click send. My code is :-

Code:
DoCmd.SendObject acSendReport, "User", acFormatSNP, "user@test.co.uk", , , "ReportName", "Please find attached your Report.", , True

I have tried adding:-

outlook.mailitem.send
mail.send

Can anyone point me in the right direction
 
The 'True' you have at the end of the line relates to editing the email before sending it. so a change to

Code:
DoCmd.SendObject acSendReport, "User", acFormatSNP, "user@test.co.uk", , , "ReportName", "Please find attached your Report.", , [COLOR=red]False[/color]

will send the email without the option to edit (so the email doesn't open).

However (& it's a big however), you'll then run into other issues (google for "Outlook Object Model Guard" or search this site if you want to know more).

 
Hi ajrimmer,

that worked.. I had tried it before it had not, but i figured what it was. The extra comma in my code before the True/false part.

I had seen the comments before regarding Outlook Object Model Guard and now I know what is all about....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top