Email Button

  • Thread starter Thread starter Gary
  • Start date Start date
G

Gary

Hello
Is it possible to make a button on a form which
automatically opens my email client (outlook express)
and prefills the email address i am sending to from a
field on the same form?
Many thanks
Gary
 
Sure. Here is the code to put behind your command button:

Dim strEmail as String

strEmail = "mailto:" & Me!MyEmailField
Application.FollowHyperlink Address:=strEmail

NOTE: The table field to which your text box, MyEmailField, is bound
should be a Text type field - not a Hyperlink type field.

hth,
 
Not with the FollowHyperlink method - it simply does what its name implies:
follows a hyperlink, either an "http://" or a "mailto:" If you want to
automate creating and sending emails, you would need to use Automation and
Outlook. (Not OE. AFAIK, Outlook Express does not expose its properties
and methods to Automation.)

Here are a couple of links to give you an idea of how it works:

http://tinyurl.com/2knwj

Using Automation to Send a Microsoft Outlook Message
http://support.microsoft.com/?id=161088

Use Automation to Send a Microsoft Outlook Message using Access 2000
http://support.microsoft.com/?id=209948

Also, have a look at Tony Toews' email page:

http://www.granite.ab.ca/access/email.htm



--
Cheryl Fischer
Law/Sys Associates
Houston, TX

Sean said:
Is this also possible to pull in a field name as the Subject? And fixed
text as the body?
 
Thanks for that Cheryl - works great!
Like Sean asked - is it also possible to add a subject
line and a message body in the code too?
Many Thanks - Gary
 
Hi Sean
After using and playing with Cherly's example for a
while, I think I got close to what you are looking for:

Dim strEmail As String

strEmail = "mailto:" & Me![e-mail address] & "?
subject=" & [First Name]
Application.FollowHyperlink Address:=strEmail


That is the code I used in the "on click": it loads OE
inserts my customers email address and in the subject
line my customer's first name.

I do not know how to put text automatically into the body
of the email.

PS. I am fairly new to this, this just worked for me!
Good Luck


-----Original Message-----
Is this also possible to pull in a field name as the
Subject? And fixed text as the body?
 
Thanks, very helpful.

Cheryl Fischer said:
Not with the FollowHyperlink method - it simply does what its name implies:
follows a hyperlink, either an "http://" or a "mailto:" If you want to
automate creating and sending emails, you would need to use Automation and
Outlook. (Not OE. AFAIK, Outlook Express does not expose its properties
and methods to Automation.)

Here are a couple of links to give you an idea of how it works:

http://tinyurl.com/2knwj

Using Automation to Send a Microsoft Outlook Message
http://support.microsoft.com/?id=161088

Use Automation to Send a Microsoft Outlook Message using Access 2000
http://support.microsoft.com/?id=209948

Also, have a look at Tony Toews' email page:

http://www.granite.ab.ca/access/email.htm



--
Cheryl Fischer
Law/Sys Associates
Houston, TX


text as the body?
 
Back
Top