Setting hyperlink for email

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • jodyblau

    Setting hyperlink for email

    I have noticed that if you right click on a hyperlink field and edit
    the hyperlink, you can set it to be an email address and open up
    Outlook when it is clicked.

    I have been trying to set this up the same way at runtime, but I
    haven't been able to get it to work.

    The field [Email] is set to be a hyperlink field. Then I try this:

    myString = Me.Email & "#" & "mailto:" & Me.Email & "#"
    Me.Email = myString


    This is essentially the same method I use to open up things like
    folders and such, but when I try it here, it still trys to open it up
    with the prefix http://

    I tried to pattern the string after the way that access sets the
    hyperlink when I manually configure the hyperlink to be an email
    address; but apparently I am missing a step.

    My goal isn't to have the person type in the subject line and body of
    the email within Access, but rather I just want to have Outlook open a
    new message window, just like it does when you manually configure the
    hyperlink to be an email address.

    Any thoughts?

    Thanks,

    Jody Blau

  • jodyblau

    #2
    Re: Setting hyperlink for email

    I figured it out.

    The problem was in the data provided by the reference to Me.Email

    It works when I made the following adjustment:

    Dim myString As String
    myString = Me.Email.Hyperl ink.TextToDispl ay & "#" & "mailto:" &
    Me.Email.Hyperl ink.TextToDispl ay & "#"

    Me.Email = myString

    Which I placed in my afterupdate event.


    Jody

    Comment

    Working...