Results 1 to 8 of 8
  1. #1
    tcheck is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    131

    Create Hyperlink and send via email

    We currently send an email to internal users that points to hyperlink address. We create an email, enter the symbol(ABC for example) and we then right click and point to the correct directory for the PDF document and the link is created so the user sees



    ABC

    in the email, clicks on it and the PDF is opened. I tried to create this in a query and export it to a TXT document and it works but it does not look as nice, I get something like this;

    <a href="http://Mywebsite.net/rpts/ABC.pdf">CYBX</a>

    How can I email the symbol with the link burried behind it but when clicked on (in an email) it goes to that link?

    Thanks.

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    This worked for me:

    Dim appOutLook As Outlook.Application
    Dim MailOutLook As Outlook.MailItem
    Set appOutLook = CreateObject("Outlook.Application")
    Set MailOutLook = appOutLook.CreateItem(olMailItem)
    With MailOutLook
    .To = "email address here"
    .Subject = "Test"
    .BodyFormat = olFormatRichText
    .HTMLBody = "<a href='http://Mywebsite/ABC.pdf'>CYBX</a>"
    '.Send
    .Display
    End With
    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.

  3. #3
    tcheck is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    131
    Thanks.

    Does the .HTMLBody = "<a href='http://Mywebsite/ABC.pdf'>CYBX</a>" come out of the Query where as CYBX would be [Symbol] in the query?

  4. #4
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Sorry, I missed the point about exporting to a text document. In my testing, doesn't export as link, just simple text, not even clickable.

    Don't understand, if user is browsing to file, why is a query involved? Why export to text file? Don't you want the link in the email body?
    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.

  5. #5
    tcheck is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    131
    Because there may be many each day, so there may be 5-15 different symbols for that day. The ABC would also come from the database so it should be

    "<a href='http://Mywebsite/"& [Symbol] & ".pdf">[Symbol]</a>

  6. #6
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Need more concatenation, missing an apostrophe:

    "<a href='http://Mywebsite/" & [Symbol] & ".pdf'>" & [Symbol] & "</a>"

    Still not fully understanding behavior. Does user 'right click and point to the correct directory' and this is saved to table then code runs to get value from table? How is export to text file involved in this email process?
    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.

  7. #7
    tcheck is offline Competent Performer
    Windows 7 Access 2007
    Join Date
    Nov 2010
    Posts
    131
    I know the format is not exact since i left the office.

    It would run automitcally after a new symbol(s) was entered into the database and the query would produce ablist for that day of symbols. And then a user would get an email with the symbol and the underlying link. It works now but does not look as nice.

  8. #8
    June7's Avatar
    June7 is offline VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,929
    Does not look nice in a text file? Afraid can't help with that. As stated earlier, my test of export does not produce clickable link.

    If you want to provide db for analysis, follow instructions at bottom of my post.
    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. How to send an email?
    By George in forum Access
    Replies: 6
    Last Post: 06-08-2012, 07:48 AM
  2. Send a PDF via email.
    By tcheck in forum Access
    Replies: 3
    Last Post: 08-30-2011, 02:31 PM
  3. Replies: 4
    Last Post: 04-13-2011, 10:11 AM
  4. send email to email addresses in database?
    By cnstarz in forum Access
    Replies: 5
    Last Post: 03-02-2011, 09:46 PM
  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