VBA Code Email link with Body HTML?

Posted on 2012-09-19
Last Modified: 2012-09-21
From MS Access vbs is it possible to make the url a html hyperlink?

I would assume that the modification would be in the bode= section

MY current code that works...
Just want it to say "Click Here" instead of the whole url.

'Add client email
strMailTo = "mailto:" &

'Add Subject Field
strMailTo = strMailTo & "&subject=Your%20Account%20Team"

'Add Body Field
strMailTo = strMailTo & "&body=" & cid

Application.FollowHyperlink strMailTo

Open in new window

Question by:lrbrister
    LVL 84

    Accepted Solution

    If you're sure that you're sending an HTML formatted email, you can do this:

     strMailTo & "&body=<a href="">Click Here</a>%3Fq=" & cid

    However, I don't think your current code will work for that. You'll almost certainly have to automate Outlook for that. Here's a link for doing that:

    That's for 2003, but will work for any version.

    Author Comment

    The link is fine but I need to send it to a particular email address...not someone in my Contacts List.

    Looks like I need to use the ".To" code but I can't find how to include all the argumets for that
    LVL 84
    I don't follow - you asked how to make the url a html hyperlink, and your followup doesn't seem to have anything to do with that.

    Can you explain further? Do you mean that you need to send the email to a static address, like:

    'Add client email
    strMailTo = ""

    Author Comment

    LVL 84
    Then just do as I suggested - set the value of strMailTo to your static value.

    Author Closing Comment


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    We were having a lot of "Heartbeat Alerts" in our SCOM environment, now "Heartbeat" in a SCOM environment for those of you who might not be familiar with SCOM is a packet of data sent from the agent to the management server on a regular basis, basic…
    Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
    The view will learn how to download and install SIMTOOLS and FORMLIST into Excel, how to use SIMTOOLS to generate a Monte Carlo simulation of 30 sales calls, and how to calculate the conditional probability based on the results of the Monte Carlo …
    The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now