Results 1 to 4 of 4
  1. #1
    Visfire is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    3

    Quick help w/ Mailto??

    Hey guys, I'm stuck on this one which should be simpler then I thought..

    Access data page that calls an email field called "email". I just want it to be clickable so it launches outlook .. am I going about this the wrong way?

    <SCRIPT language=vbscript>

    Sub MakeFieldLookLikeLink(email)
    On Error Resume Next
    n = email.length-1
    If (Err.Number <> 0) Then ' There is 1 (or no) field
    email.style.cursor = "hand"
    email.style.color = document.linkColor
    email.style.textDecorationUnderline = True
    Else
    For i = 0 to n
    email(i).style.cursor = "hand"
    email(i).style.color = document.linkColor
    email(i).style.textDecorationUnderline = True
    Next
    End If
    End Sub
    </SCRIPT>



    <SCRIPT language=vbscript event=Current(info) for=MSODSC>
    MakeFieldLookLikeLink(email)
    </SCRIPT>


    <SCRIPT for=email event=onclick language=vbscript>
    If email.value > 0 Then

    window.open = ????email.value??????
    End if
    End Sub
    </SCRIPT>

  2. #2
    ajetrumpet is offline VIP
    Windows Vista Access 2007
    Join Date
    Mar 2010
    Location
    N/A
    Posts
    2,694
    I'm not sure what you're doing, but it looks like you've got an HTML page there. I've never worked with a DAP so I don't know if they use a different language than VBA. I'm guessing not.

    You want to open outlook, and then do what exactly? And does a DAP use VBA? or is it only compatible with vbscript? Some portions of Outlook are I know, like the code behind a form for instance..

  3. #3
    Visfire is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    3

    RE: Quick help w/ Mailto??

    Hey Adam,

    Thanks for taking a look at this. You are correct in that this is a DAP that operates in the vbscript realm therefore regular vba is out the window. The authoring tool does allow you to specify a hyperlink bound type of field, although it only appears to be meant for html links and not email.

    Ideally, Id just like a user to be able to click on the field "email" that supplies the email address for each record, and have that information passed on as a mailto link ..such that a new emailbox is opened with the address already in the too field. A normal hyperlink w/ "mailto" normally accomplishes this

    Struggling with this one..

  4. #4
    Visfire is offline Novice
    Windows XP Access 2003
    Join Date
    Sep 2010
    Posts
    3
    Nailed it.. .. add this to a label or button

    <SCRIPT language=vbscript event=onclick for=sendmail>
    <!--
    Dim theaddress
    theaddress = email.value
    Set objOL = CreateObject("Outlook.Application")
    Set objMail = objOL.CreateItem(0)
    With objMail
    .Subject = "something"
    .To = theaddress
    .Display
    End With
    Exit Sub
    -->
    </SCRIPT>

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Need Help quick on Diffdate function
    By gonzod in forum Forms
    Replies: 2
    Last Post: 08-26-2010, 02:30 PM
  2. A quick commentary on Access
    By The Vicer in forum Access
    Replies: 2
    Last Post: 07-27-2010, 09:33 AM
  3. Quick Question
    By Imgsolutions in forum Access
    Replies: 3
    Last Post: 07-19-2010, 11:22 AM
  4. Quick Help with Printing
    By Imgsolutions in forum Access
    Replies: 1
    Last Post: 07-06-2010, 02:02 PM
  5. Replies: 1
    Last Post: 06-08-2010, 12:08 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums