Results 1 to 2 of 2
  1. #1
    banpreet is offline Competent Performer
    Windows 8 Access 2010 64bit
    Join Date
    Jul 2016
    Posts
    117

    Put Hyperlink in Email

    Hi Guys,

    I have code below that sends an email out which works perfect. I have the link posted in the email but I want it to be a hyperlink. How do I do this? The code is below and the link is highlighted in blue. What should I add to make it a hyperlink?

    Thanks!




    Dim Subject As String


    Dim Body As String
    Dim Email As String


    Subject = "Test Engineer Assignment " & GTSR_TR_ID.Value
    Body = ""
    Body = Body & "GTSR ID: " & GTSR_TR_ID.Value & vbNewLine & vbNewLine
    Body = Body & "TR ID: " & TR_ID.Value & vbNewLine & vbNewLine
    Body = Body & "Revision: " & Revisions.Value & vbNewLine & vbNewLine
    Body = Body & "Test Title: " & Test_Title.Value & vbNewLine & vbNewLine
    Body = Body & "Requestor's Name: " & cbofirst_name.Value & " " & cbolast_name.Value & vbNewLine & vbNewLine
    Body = Body & "Requestor Clock #: " & cboclock.Value & vbNewLine & vbNewLine
    Body = Body & "A/C Model: " & Me.cboACModel & vbNewLine & vbNewLine
    Body = Body & "Please go into your queue and ASSIGN TEST ENGINEER!" & vbNewLine & vbNewLine
    Body = Body & "Link to database: \\Sussff0u\ShFlsSvc2ENG\Ground_Test_Service_Reques t_System\GTSR_IDDatabase.accdb" & vbNewLine & vbNewLine -
    Body = Body & "This email was auto-generated!"

    Email = GetLevel2ApproverEmailFromModel(Me.cboACModel)


    DoCmd.SendObject acSendNoObject, "", "", Email, , , Subject, Body, True

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,930
    You have to use HTML code tags.

    Don't think possible with SendObject. Consider:

    Code:
    Private Sub Email()
    Dim appOutLook As Outlook.Application
    Dim MailOutLook As Outlook.MailItem
    Set appOutLook = CreateObject("Outlook.Application")
    Set MailOutLook = appOutLook.CreateItem(olMailItem)
    With MailOutLook
    '    .BodyFormat = olFormatRichText
        .To = "email address here"
        ''.cc = ""
        ''.bcc = ""
    '    .Attachments.Add "filepath\filename"
        .Subject = "Test"
        .HTMLBody = "Test HL: <a href='https://www.bing.com/?pc=EUPP_'>Link description here</a>"
        .Display
    End With
    End Sub
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. embed hyperlink in vba generated email
    By jlawson258 in forum Forms
    Replies: 1
    Last Post: 11-21-2016, 08:11 AM
  2. Hyperlink in Outlook Email
    By Holli in forum Programming
    Replies: 3
    Last Post: 04-22-2015, 12:32 AM
  3. Replies: 22
    Last Post: 04-24-2014, 01:56 PM
  4. Add a hyperlink to email message
    By Marianna_Air in forum Forms
    Replies: 2
    Last Post: 08-22-2012, 06:57 AM
  5. How to email a hyperlink using VBA
    By Lockrin in forum Access
    Replies: 1
    Last Post: 07-16-2010, 02:29 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