Re: Opening email client (Outlook) from Form
- From: "Ed Robichaud" <edrobichaud@xxxxxxx>
- Date: Mon, 18 Feb 2008 11:04:38 -0500
My previous reply to you bounced back, but the short answer is to use a text
field to store an email address, and the SendObject command to invoke your
default email program to send to it.
An example:
=================================
Private Sub email_Click()
Dim strEmail As String
Dim strMailSubject As String
Dim strMsg As String
If IsNull([txtEmail]) Then
MsgBox " No address found ! ", vbExclamation, "Missing e-mail"
Else
On Error Resume Next
strEmail = Me![Email]
strMailSubject = ""
DoCmd.SendObject , , , To:=strEmail, subject:=strMailSubject,
MessageText:=strMsg
End If
If Err.Number = 2501 Then
MsgBox " Email message cancelled ", vbExclamation
End If
Exit_Email_Click:
Exit Sub
Err_Email_Click:
' MsgBox " Email message cancelled ", vbExclamation
MsgBox Error$
Resume Exit_Email_Click
End Sub
===========================
"Graham" <Graham@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:9BF2731E-6BA1-4072-945E-944916138949@xxxxxxxxxxxxxxxx
Having searched the forums for information on this, there is much
contradictory advice. I have a Field (Personal email) in a Table, and on
an
associated Form. This field has an email address, and/or can be updated
with
an email address. If I enter a new email address, I want it to be
formatted
so as to launch my email client when I double click it.
Some advice says to format it as a hyperlink field, which adds "http://
"in
front of the email address, which is obviously not going to work. If I
edit
this and add "MailTo" then it will work, but each entry has to be manually
edited, as do any new additions.
Should I format as a hyperlink, or leave as a text box ?
If I set the property for the Double Click,
"FollowHyperlink(MailTo:&Personal email)" This doesn't appear to work ?
Could some one please clarify what I should do, and/or tell me what's
wrong
with the above property so it will work ?
Many Thanks
.
- Prev by Date: Re: A really really simple report
- Next by Date: Re: using macros to open specific record in a form
- Previous by thread: Re: using macros to open specific record in a form
- Next by thread: Access 2007 from Access 2003
- Index(es):
Relevant Pages
|