Sending automatic email notification using SendObject

Erik

Registered User.
Local time
Today, 23:28
Joined
May 16, 2000
Messages
19
I have been able to write a line of code in a form that is called "SafetyLogF" that generates an email message in either Outlook or Eudora and attaches an HTLM document as the object.

However, the user must manually enter the recipient's email address because I am not sophisticated enough to understand what needs to be done to take the email address and place it in the email document automically. I know this can be done, I have just not been able to see an example that clicks for me. So I am asking for a little help.

The command button that will launch this automatic email notification is in this form called "SafetyLogF". The "SafetyLogF" contains a field called "email". The "email" field is not displayed but contains the recipient's email address that should go in the "To" line of the mail message.

The code that I am trying to write is this:

DoCmd.SendObject acSendReport, "Safety Item Assignment", acFormatHTML, SafetyLogF!, , , "Safety Log Item", "You have been assigned a Safety Log Item. The attached document is a description of the item. Please open the BNSF Safety Log and browse through your assigned issues.", True

I think that I have to define the variable "SafetyLogF", but am not sure how to do this so that everything works.

Can someone help me here?
 
I think this will do it for you, let me know if you have problems or more questions with it.

DoCmd.SendObject acReport, "Safety Item Assignment", "HTML(*.html)", "YOUREMAIL@here.com", , , "Subject - Safety Report", , True
 
After re-reading your post I am not sure I answered your question at all so check out this link. I think you will find the answer you are looking for.

Help with SendObject command help!
 
I figured this out by taking bits and pieces of code from other posts similar to my problem. The answer was pretty straight forward, so I probably was not explaining what I needed clearly enough.

Here is the line of code that does exactly what I want to do, and it does it perfectly:

DoCmd.SendObject acSendReport, "Safety Item Assignment", acFormatHTML,
, , , "Safety Log Item", "You have been assigned a Safety Log Item.
The attached document is a description of the item. Please open the BNSF
Safety Log and browse through your assigned issues.", False
 

Users who are viewing this thread

Back
Top Bottom