making the entries in e-mail field a hyperlink to send an e-mail in outlook

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • emandel
    New Member
    • Dec 2006
    • 65

    making the entries in e-mail field a hyperlink to send an e-mail in outlook

    I have searched the forum and the help and am still very confused.

    I have a simple table with one of the fields e-mail.
    I have a simle form for that table.

    Where the contact's e-mail comes up, (either in the form or the table) I would like Access to show me a hyperlink that when I click on it, it opens a new message to that e-mail address. Similar to when you have a hyperlinked e-mail address in MSWord and most other office programs.

    Even nicer would be to add a button on the form saying "send e-mail to this person"

    Please can you help with this.
    Thank you
  • MMcCarthy
    Recognized Expert MVP
    • Aug 2006
    • 14387

    #2
    Originally posted by emandel
    I have searched the forum and the help and am still very confused.

    I have a simple table with one of the fields e-mail.
    I have a simle form for that table.

    Where the contact's e-mail comes up, (either in the form or the table) I would like Access to show me a hyperlink that when I click on it, it opens a new message to that e-mail address. Similar to when you have a hyperlinked e-mail address in MSWord and most other office programs.
    In the table with the email field set the fields data type to hyperlink.

    Mary

    Comment

    • emandel
      New Member
      • Dec 2006
      • 65

      #3
      Originally posted by mmccarthy
      In the table with the email field set the fields data type to hyperlink.

      Mary
      I tried that, but that opens up the "e-mail address" in Internet explorer, thinking that is a web address!. i.e. if I type a web address it works, but it doesn't work in the sense that an e-mail address gets forwarded to a e-mail program!

      Comment

      • MMcCarthy
        Recognized Expert MVP
        • Aug 2006
        • 14387

        #4
        Originally posted by emandel
        I tried that, but that opens up the "e-mail address" in Internet explorer, thinking that is a web address!. i.e. if I type a web address it works, but it doesn't work in the sense that an e-mail address gets forwarded to a e-mail program!
        Change the field back to text temporarily. Then run find and relplace and replace all http:// with mailto:

        Then change back to hyperlink again.

        When adding new email addresses add them with mailto: at the start of each address

        Mary

        Comment

        • emandel
          New Member
          • Dec 2006
          • 65

          #5
          Thank you, that worked

          Is there any way for access to add the Mailto: without the operator adding it every entry? Other than having that the default text and adding next to it?

          Comment

          • MMcCarthy
            Recognized Expert MVP
            • Aug 2006
            • 14387

            #6
            Originally posted by emandel
            Thank you, that worked

            Is there any way for access to add the Mailto: without the operator adding it every entry? Other than having that the default text and adding next to it?
            Probably the easiest way is to hide the actual email control and create an unbound textbox for the user to enter the email address. Then in the after update event of this textbox make the email control equal to correct string.


            Code:
            Me.email = "mailto:" & Me.NewTextbox
            Mary

            Comment

            • emandel
              New Member
              • Dec 2006
              • 65

              #7
              Ok that works in the sense that on the form I now see hyperlink that says mailto:[person's e-maill asddress]

              however it does not allow me to click on the hyperlink.

              Do I need to put something in the code f under "click" under "event"?

              Comment

              • NeoPa
                Recognized Expert Moderator MVP
                • Oct 2006
                • 32635

                #8
                Instead of hiding the e-mail control, try simply locking it so the operator can click on it after the value has been updated by the code.

                Comment

                • MMcCarthy
                  Recognized Expert MVP
                  • Aug 2006
                  • 14387

                  #9
                  Originally posted by emandel
                  Ok that works in the sense that on the form I now see hyperlink that says mailto:[person's e-maill asddress]

                  however it does not allow me to click on the hyperlink.

                  Do I need to put something in the code f under "click" under "event"?
                  Go to the properties of the new textbox and at the end of the format properties there should be a hyperlink property.

                  Comment

                  • NeoPa
                    Recognized Expert Moderator MVP
                    • Oct 2006
                    • 32635

                    #10
                    Oops.
                    Clearly this is a better solution than mine so please ignore my earlier post.

                    Comment

                    • emandel
                      New Member
                      • Dec 2006
                      • 65

                      #11
                      Sorry, it still isn't working properly.
                      What I have now is a field where the operator puts in just the e-mail address, this is the field that goes into the table.

                      A second text box has
                      Code:
                      ="mailto:" & [e-mail]
                      in the control source and the properties is set as a hyperlink.

                      On the form, the second text box shows as a hyperlink (blue underline etc) it says mailto: and the email address. i.e. it looks like it should work, but nothing happens when you click on it.

                      Suggestions?

                      Comment

                      • nico5038
                        Recognized Expert Specialist
                        • Nov 2006
                        • 3080

                        #12
                        Don't use a textbox, but insert a Hyperlink (Insert/Hyperlink menu).
                        Then use:
                        Me.MailLink.Hyp erlinkAddress = "mailto:" & Me.EmailField

                        Nic;o)

                        Comment

                        • pks00
                          Recognized Expert Contributor
                          • Oct 2006
                          • 280

                          #13
                          What if u created the txtbox, even if its bounded, does not matter, u can make the forecolor blue and underline, u can use the mouseover event to make a pointy arrow

                          then use the click event to open it up, somethng simple like DoCmd.SendObjec t

                          eg
                          private sub myemailfield_Cl ick()
                          On Error Resume Next
                          DoCmd.SendObjec t , , acFormatTXT, me.myemailfield , , , , , True
                          'If error occurred and user has not cancelled
                          If Err.Number <> 0 And Err.Number <> 2501 Then
                          MsgBox "An error has occurred. " & Err.Description
                          End If
                          end sub

                          Comment

                          • emandel
                            New Member
                            • Dec 2006
                            • 65

                            #14
                            Nico,

                            your suggestion makes sense to me, but I still can't get it to work.
                            When I insert the hyper link it asks me to choose what the address is. Is it an e-mail address? web page etc.
                            It would mke sense to choose e-mail. but when I do that and than type
                            Code:
                            ="mailto:" & doners.[e-mail]
                            The outlook new e-mail message opens (which is good) but tin the to: field of the new message it shows "doners.[e-mail] (which is not good)
                            :(

                            Comment

                            • NeoPa
                              Recognized Expert Moderator MVP
                              • Oct 2006
                              • 32635

                              #15
                              You have
                              Code:
                              ="mailto:" & doners.[e-mail]
                              but Nico suggested
                              Code:
                              Me.MailLink.HyperlinkAddress = "mailto:" & Me.EmailField
                              Is there any reason why you didn't use Nico's suggestion?
                              I would expect that to work.
                              It seems to be different in two ways :
                              1. Uses Me. rather than doners.
                              2. Sets .HyperlinkAddre ss explicitly (unsure what yours is setting).
                              If it doesn't work, one thing I've found in the past (within Outlook actually but maybe worth looking at here if all else fails) is that "smtp:" sometimes works when "mailto:" doesn't.

                              Comment

                              Working...