Starting Outlook from Access

S

Shree

Hello!
I need some help with the following:
I have a text box which shows email address of employees.
I need to make it a hyperlink so that when it is clicked
Outlook will start with the TO: having the recepients
address in it. I tried various ways that Access allows to
insert hyperlink and choosing email address option, but
all that will hard code the address in the recepients
name. I was looking for a <a href:mailto> kind of
functionality used in HTML to dynamically fire Outlook
with the respective recepient in the To: box. Please help
me with this. I need to get it done asap!
Thanks in advance.
Shree.
 
C

Cheryl Fischer

Hello Shree,

You do not necessarily have to use a Hyperlink datatype in your table to get
this job done. Just use a Text type field containing an email address. If
you like, on your form, you can make the ForeColor of the textbox blue and
underlined, so that it looks like a link. Then, in the DoubleClick event of
the TextBox on the form or in the Click event of a Command Button on your
form, you can insert the following VBA code:

Dim strEmail as String

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

hth,
 
S

shree

Thank you very much! You saved my life!



-----Original Message-----
Hello Shree,

You do not necessarily have to use a Hyperlink datatype in your table to get
this job done. Just use a Text type field containing an email address. If
you like, on your form, you can make the ForeColor of the textbox blue and
underlined, so that it looks like a link. Then, in the DoubleClick event of
the TextBox on the form or in the Click event of a Command Button on your
form, you can insert the following VBA code:

Dim strEmail as String

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

hth,

--

Cheryl Fischer, MVP Microsoft Access
Law/Sys Associates, Houston, TX





.
 

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