Email Trick

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have posted this before, but the answer I got was too complicated for my
neebie brain to comprehend.

I have created a form and one of the field displayed is the email address of
the customers. I would like to have the user be able to click on it and have
it lauch Outlook with the email address already populated.

I am too new it this to be able to do much with an answer that doesn't
carefully walk me through what to do, much to my frustration. Any help would
be appreciated. Thanks.
 
Simple. Make sure that your email field is a hyperlink datatype. You may have
to reenter any existing email addresses to get it to work properly.
 
I tried that. I made the field a hyperlink data type. I re-entered the email
address in the table. When I click it I get the following message:

Unable to open http://[email protected] Cannot locate the Internet
Server or Proxy server.
 
I tired that. I re-entered the hyperlink address. I set the field property to
hyperlink. I got the following message when I click the hyperlink:

Unable to open http://[email protected]. Cannot locate the Internet
server or proxy server.
 
Check Help for information about SendObject. In brief, if the e-mail
address is in the field [E_Mail], the syntax for a command button's Click
event would be:
DoCmd.SendObject , , , [E_Mail]

Note that you need all of the commas. You can also add CC, BCC, Subject,
and Message, plus a few other things. For instance:
DoCmd.SendObject , , , [E_Mail],"(e-mail address removed)"
will send a copy to the added address. Help contains the details of the
syntax. Just remember that if you want to skip the BCC (for instance), but
you want Subject and Message, you will need to add a comma as a placeholder
for BCC:
DoCmd.SendObject , , , [E_Mail],"(e-mail address removed)", ,"Subject", "Message text"

You could use the same code in the click event or double-click event of the
text box bound to [E_Mail], or wherever you choose.
 
One way to do this would be to keep the field type as text, and put the
following code into the double click event of the text box on your form:

FollowHyperlink ("mailto://" & Me.Email)

If your field is not called Email then you will have to change Me.Email to
what it is called on the form.this would save you from having to enter all
the email addresses with the mailto:// prefix, and putting it in the double
click will ensure that it doesnt keep popping up when you are simply trying
to change the email address.

Hth

jon
 
Hi

You need to "MailTo"

Store this is the table field

MailTo:[email protected]

____________________________

A hyperlink is just that (a hyperlink) but you are not looking for a
hyperlink you are looking for an email (I think). You would use a hyperlink
to (for example) open a webpage.

Hope this helps
 
That would be:

mailto: & Me.EmailControlname, not mailto:// & Me.EmailControlname as in:

Dim strMail As String
strMail = "#MailTo:" & Me.EmailControlname & "#"
 
I just copied it direct from my form were I set it up last year and it
certainly been working fine for me in Access 2000 perhaps the // isn't
required however it shouldnt give you any problems.

Jon
 
Thanks everyone for your help. This is what I finally ended up doing. I
added a command button on the form next to the email address field (called
E-Mail). When the button is clicked it launches Outlook and auto-populates
the email address.

Here is the code that I used:

Option Compare Database

Private Sub EmailCmd_Click()
On Error GoTo HandleErr
If Me.Dirty Then DoCmd.RunCommand acCmdSaveRecord
EnableEmail
ExitHere:
Exit Sub
HandleErr:
Select Case Err
Case Else
MsgBox Err & ": " & Err.Description, "Form_allContacts.Emailcmd_Click"
End Select
Resume ExitHere
End Sub


Private Sub EmailCmd_Enter()

End Sub


Private Sub EnableEmail()
On Error Resume Next
EmailCmd.HyperlinkAddress = "mailto:" & Me![E-mail]
End Sub

Private Sub Form_Current()
On Error Resume Next
EnableEmail
End Sub
 
Back
Top