Open outlook by doubleclicking a text box

T

Today

I want to double click a text box, containing an email
address, in a form set to continuous records, and have MS
Outlook open up a new email with that specific record's
email address in the To: line.

Any help would be appreciated. Thanks.
 
G

Graham Mandeno

Hi Today

You are probably best just to use the default mail transport, either via
SendObject or FollowHyperlink:

Private Sub EmailAddress_DblClick(Cancel as integer)
If Len(EmailAddress.Text) > 0 then
'either this:
docmd.SendObject To:=EmailAddress.Text
'or this:
application.FollowHyperlink "mailto:" & EmailAddress.Text
Else
Msgbox "No email address"
End If
End Sub

Both methods will produce the same result, except that SendObject will raise
an error if the user cancels the message without sending it. If you're not
interested in trapping such a situation, then use FollowHyperlink.

--
Good Luck!
Graham Mandeno [Access MVP]
Auckland, New Zealand

Return mail address is invalid in a vain attempt to reduce spam.
Feedback is welcome at: (e-mail address removed)
Please post new questions or followups to newsgroup.
 

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