How do I evoke email automatically

  • Thread starter Thread starter Mike Healy
  • Start date Start date
M

Mike Healy

Guest
Hi,

I have a database which I would like to have a button next to my contacts which when pressed automatically fires up the email?

Can this be done?

And how?

Thanks

Mike Healy
 
Have a look at SendObject in teh Help files.
 
When you place a button on a form in design view the command button wizard allows you to set the button up to open an application.
 
Sample argument

Hi,

Below is some sample code that will invoke your mail client and use the e-mail address contained in the [EmailAddress] field and pass it on to your mail client together with a subject line and some body text. Ensure that you have a field called [EmailAddress] on your form if you want to use the code as is. Call your button btMailToCustomer.

CODE:
---------------------------------------------------------------------------------

Private Sub btMailToCustomer_Click()
On Error GoTo Err_btMailToCustomer_Click

Dim stDocName As String

DoCmd.SendObject , , , [EmailAddress], , , "Enter your subject here", "This e-Mail was generated by ....blah...blah"

Exit_btMailToCustomer_Click:
Exit Sub

Err_btMailToCustomer_Click:
MsgBox Err.Description
Resume Exit_btMailToCustomer_Click

End Sub

-----------------------------------------------------------------------------------


See the attached JPEG for a screenshot of my form.

Cheers
 

Attachments

  • mailsample.jpg
    mailsample.jpg
    24.5 KB · Views: 203

Users who are viewing this thread

Back
Top Bottom