Results 1 to 5 of 5
  1. #1
    nicki is offline Novice
    Windows 10 Office 365
    Join Date
    Jun 2022
    Posts
    3

    Convert Email body into HTML

    Hello,

    I have VBA code that reads from a table and sends Emails to the recipient by attaching a report.
    The body of the email says something like:

    StrBody = "Hello etc."

    The requirement is to add a HYPERLINK to the body of the email so it says something like:

    StrBody = "Hello click here to see something"

    The "Here" is an actual hyperlink that takes them to a sharepoint site.



    I can do it by displaying the actual hyperlink and the recipient will see the url (ugly solution) but I really want the word to say Here.

    Access VBA does not recognize the html brackets like <a href = "https:// etc".

    How do I do it ?

  2. #2
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,914
    You would construct the html just as it would be on a html page.
    You would however need to use HTMLBody.
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  3. #3
    nicki is offline Novice
    Windows 10 Office 365
    Join Date
    Jun 2022
    Posts
    3
    I am not savvy in HTML, I just now that I have to do this to create a Hyperlink:
    Code:
    <a href="url">Click here </a>
    How do I force VBA to understand that this is HTML code ? I obviously do not have the option to create a variable and declare it as HTML.

    Thanks

  4. #4
    Join Date
    Jan 2017
    Location
    Swansea,South Wales,UK
    Posts
    4,914
    Outlook has .HtmlBody where you can build text in html format. Google to see how a link is constructed and copy that logic.
    This member was trying to construct html and a useful link is in that thread.
    https://www.accessforums.net/showthr...highlight=Html
    Please use # icon on toolbar when posting code snippets.
    Cross Posting: https://www.excelguru.ca/content.php?184
    Debugging Access: https://www.youtube.com/results?sear...bug+access+vba

  5. #5
    nicki is offline Novice
    Windows 10 Office 365
    Join Date
    Jun 2022
    Posts
    3
    That worked !
    thank you

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

Similar Threads

  1. Adding Excel Cells To Email html body
    By DMT Dave in forum Access
    Replies: 15
    Last Post: 04-24-2022, 11:52 AM
  2. Adding Items To HTML Email Body
    By DMT Dave in forum Access
    Replies: 6
    Last Post: 01-03-2022, 04:15 AM
  3. email body using html format
    By baronqueefington in forum Programming
    Replies: 5
    Last Post: 02-03-2015, 03:44 PM
  4. Sending Reports with email body having HTML
    By CeVaEs_64 in forum Access
    Replies: 28
    Last Post: 11-26-2014, 12:13 PM
  5. Export html to body of email issue
    By mmart33 in forum Reports
    Replies: 3
    Last Post: 02-28-2013, 03:16 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