Results 1 to 3 of 3
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    mailto:address (Office 97 SR2)

    Hi

    I have a field in a form for e-mail address's I would like to make it a mailto: hyperlink for obvious reasons.

    Can anyone help please.

    Novice user.

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16> in advance
    If you are a fool at forty, you will always be a fool

  2. #2
    Silver Lounger
    Join Date
    Dec 2000
    Location
    Northampton, Northamptonshire, England
    Posts
    1,951
    Thanks
    2
    Thanked 1 Time in 1 Post

    Re: mailto:address (Office 97 SR2)

    Hi Hans

    Idea 3 worked best for me, where I went wrong was not including the maito: when I set the field to hyperlink it just put http: in front instead of maito:

    Thanks very much.
    If you are a fool at forty, you will always be a fool

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: mailto:address (Office 97 SR2)

    Idea 1: Put a command button next to the text box. The user must click this button to create an e-mail. Put the following code in the OnClick event of the command button:

    If Not IsNull(Me.Text1) Then
    Application.Hyperlink "mailto:" & Me.Text1
    End If

    Replace Text1 by the name of your text box.

    Idea 2: The user must double-click the text box to create an e-mail. Put the following code in the OnDblClick event of the text box:

    If Not IsNull(Me.Text1) Then
    Application.Hyperlink "mailto:" & Me.Text1.Text
    End If

    We use Text1.Text here because the text entered by the user may not have been saved yet. When you refer to Text1 without naming a property, you are actually referring to the default property of the text box, that is the Value property. Value is the "saved" text, Text is the "current" text.

    Idea 3: If the text box is bound to a field in the record source of the form, make that field into a hyperlink field. You'll have to prefix e-mail addresses with mailto: for this to work (e.g., mailto:BillG@microsoft.com), but you don't need code - since you made the field into a hyperlink field, it "knows" what to do.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •