Macro to grab email address and open Outlook

D

duncanjx

Hi there
I am trying to write a simple macro to be able to send an email based
on an emai address in a form.
tblAgency Details has a field EmailAddress (data type is text)
I have a Command Button on a form frmAdd Agency Details to run a
macro.

Macro name is SendEmail -
Action is only SendObject
There are only two items in the Action Arguments
To: =[EmailAddress]
Edit Message: Yes (I only want Outlook to
load with the email address)


So far it does not work.
When I have a field for a Web Address and the data type is a
hyperlink
that works well for me.
Any suggestion about the email address?
Cheers
 
D

Dale Fye

Duncan,

Rather than running a macro. Take a look at the SendObject method.

Private Sub cmd_Email_Click

Docmd.sendObject ..........

End Sub

you can specify the title, the addressee, the message text, and whether to
open the application from the SendObject method.

HTH
Dale
 
D

duncanjx

Duncan,

Rather than running a macro. Take a look at the SendObject method.

Private Sub cmd_Email_Click

Docmd.sendObject ..........

End Sub

you can specify the title, the addressee, the message text, and whether to
open the application from the SendObject method.

HTH
Dale

--
Don''t forget to rate the post if it was helpful!

email address is invalid
Please reply to newsgroup only.



Hi there
I am trying to write a simple macro to be able to send an email based
on an emai address in a form.
tblAgency Details has a field EmailAddress (data type is text)
I have a Command Button on a form frmAdd Agency Details to run a
macro.
Macro name is SendEmail -
Action is only SendObject
There are only two items in the Action Arguments
To: =[EmailAddress]
Edit Message: Yes (I only want Outlook to
load with the email address)
So far it does not work.
When I have a field for a Web Address and the data type is a
hyperlink
that works well for me.
Any suggestion about the email address?
Cheers- Hide quoted text -

- Show quoted text -

Thanks for the reply Dale
Don't know enough yet to use your suggestion.
I have no experience with code, so am not sure what to do.
I have only managed a No data code for a report to date.
Duncan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top