objmailitem.send vs DoCmd.SendObject

liddlem

Registered User.
Local time
Today, 20:35
Joined
May 16, 2003
Messages
339
Hi there
I have implemented both methods to send an email from my form, but it seems that there are subtle differences.

It seems that 'objMailItem.Send', creates and sends the message 'silently' (no confirmation from the user is required), whereas the 'DoCmd.SendObject' method requires the user to actually click the 'Send' button from Outlook.

In both cases, I need to attach a report that is created by access when the user clicks the my 'Send Email' button.

I have managed to get it working using 'DoCmd.SendObject'.
But it seems that the 'objMailItem.Send' method will only attach an existing file, (saved somewhere on the system)

Are you able to advise me how to attach an access report that is generated at run time.

Thanks
 
DoCmd.SendObject is an implicit method used to Create an email, with or without an Object as its attachment.

With Outlook object creation, you have a much more flexible choice of attaching files, setting formats, sending etc. I am quiet surprised the objMailItem.Send does not involve any human interaction, normally it will come up with user confirmation, to authorize the application that is sending an email on your behalf.

Anyway, normally people will go for Outlook object creation under several constraints. Some being (on top of my head),

  1. You need to rename the report.
  2. You need to attach more than one file/doc.
  3. Set the format to HTML.
If you have nothing from the above list, I would stick to DoCmd.SendObject, I know pressing a button is a hard work, but again you can avoid the hassle of coding !
 
the 'DoCmd.SendObject' method requires the user to actually click the 'Send' button from Outlook.

really? it is more a case of RTBM, me thinks
 

Users who are viewing this thread

Back
Top Bottom