Re: Opening email client (Outlook) from Form

Tech-Archive recommends: Fix windows errors by optimizing your registry



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



.



Relevant Pages

  • Re: parse cell contents
    ... extract the date I will get the yyyy-mm-dd format. ... What we will do is first look at the first word in the string. ... Dim ValidEntry As Boolean ... 'Set the pattern by using the Pattern property. ...
    (microsoft.public.excel.programming)
  • Re: Setting field properties in code
    ... format that the user has defined in the Windows Control Panel, ... >> Sub StandardProperties(strTableName As String) ... >> Dim tdf As DAO.TableDef 'Table nominated in argument. ... >> Dim ind As DAO.Index ...
    (comp.databases.ms-access)
  • Re: Zellformatierung vQ=B6llig_selbstherrlich_=2897=29?=
    ... indem Du das Format selbst exakt defninierst. ... >> Public Sub Sammeln(Name As String) ... >> Dim EingangAs String ... Eine Alternative ist auch der Makro-Recorder während Du eine Zelle als Text ...
    (microsoft.public.de.excel)
  • Re: Sub reagiert trotz Exit Sub
    ... Dim EVMsg As String ... MsgBox gsMessages ... Ereignisse eintreffen und nachdem die MsgBox vom Benutzer ...
    (microsoft.public.de.vb)
  • Re: tab in userform locks program
    ... > I am a VBA newbie and have not been using DIM in my code so it is ... declare a variable at the top of a standard module using Private (module ... You may notice that I used Format$ instead of Format. ... but Format$ returns a String whereas ...
    (microsoft.public.excel.programming)