mailto: with outlook from a form

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

Mike

Hi all,
I have a form that contains information about my
custumors. 1 field contains his email address. I would
like to be able when I click on that field, outlook opens
and that persons email address is filled in automatically
in the TO: field in outlook.
I know there is a way with a link to open outlook but I
still have to fill in the address manually.
Any suggestions?
THX
Mike
 
Mike said:
Hi all,
I have a form that contains information about my
custumors. 1 field contains his email address. I would
like to be able when I click on that field, outlook opens
and that persons email address is filled in automatically
in the TO: field in outlook.
I know there is a way with a link to open outlook but I
still have to fill in the address manually.
Any suggestions?
THX
Mike

Assuming Outlook is the default mail client, then something like this
would do the job:

'----- start of example code -----
Private Sub EmailAddress_Click()

Dim strEmail As String

If Not IsNull(Me.EmailAddress) Then
strEmail = Me.EmailAddress
If Left(strEmail, 7) <> "mailto:" Then
strEmail = "mailto: " & strEmail
End If
Application.FollowHyperlink strEmail
End If

End Sub
'----- end of example code -----

Although I prefer to use the DblClick event instead, to keep from
accidentally starting a message when just "clicking around".
 
Back
Top