Direct Email Links in Forms launch MS Outlook mail message

  • Thread starter Thread starter Frank Camean
  • Start date Start date
F

Frank Camean

I created my own CONTACTS form in Access. I have an
associated CONTACT Table that relates to it. In that
table is a field for tracking Email addresses for each
contact. In the form itself, I would like to click on a
contacts email address and have it automatically launch my
MS Outlook New Mail Message Form.

In some applications, such as HTML, the property you need
to attach is called "Mail To:" properties. What is it in
Access?

I tried creating the field as a hyperlink, but that didn't
work. It goes out and looks for http://[email protected]

That's not what I need. I just want to add email
addresses to my contacts and then be able to clink on
their email addresses (whether hyperlinked or not) and
have MS Outlook open up a new email message with that
contacts name in the TO ADDRESS.

Is this possible?
 
Hi Frank,

You won't believe this...MailTo! ;o) Example follows:

Private Sub CustomerEmail()
On Error GoTo Err_CustomerEmail
Dim strEmail As String
Dim strSubject As String
Dim strMailto As String

'Test for a valid email value
With Me
If IsNull(Me.Email) Then 'This field is the text box on the form
that contains the email address
.imgEmail.Visible = False 'imgEmail is an image control the user
clicks on to launcg the mail application
Exit Sub
End If
'If we made it past the above validation then process the email
strSubject = "Your account" 'Or whatever subject you like
.imgEmail.Visible = True 'Make the image controlvisible
(normally hidden)
strEmail = .Email 'Assign the value of the
"Email" textbox to the string variable
strMailto = "mailto:" & strEmail & "?subject=" & strSubject ' Build
the MailTo line
.imgEmail.HyperlinkAddress = strMailto
.imgEmail.ControlTipText = "Click to email " & .Email
End With

Exit_CustomerEmail:
Exit Sub

Err_CustomerEmail:
MsgBox Err.Number & ": " & Err.Description
Exit Sub

End Sub

Jamie
 
Back
Top