Excel VBA - Outlook Html body hyperlink

Hi
I am sending an email using Excel VBA via Outlook
I want to use an html body with a hyperlink
I tried the following hoping that the hyperlink would naturally work but it doesn't

 oMsg.HTMLBody = "<html><body><font size=3  color=red>Automated invoicing powered by www.online-excel.co.za</font></body></html>"
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAsked:
Who is Participating?
 
Pratima PharandeConnect With a Mentor Commented:
oMsg.HTMLBody = "<html><body><font size=3  color=red>Automated invoicing powered by <a href=www.online-excel.co.za>www.online-excel.co.za</a></font></body></html>"
0
 
Pratima PharandeCommented:
oMsg.HTMLBody = "<html><body><font size=3  color=red>Automated invoicing powered by <a>www.online-excel.co.za</a></font></body></html>"
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks very much
0
Cloud Class® Course: C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

 
Jaes OverleyConsultantCommented:
I see that this question was already answered, but the HTML code should have quotes around the hyperlink reference URL. In order to do that in Excel VBA always use two double quotations around any quoted items within a string.

oMsg.HTMLBody = "<html><body><font size=3  color=red>Automated invoicing powered by <a href=""www.online-excel.co.za"">www.online-excel.co.za</a></font></body></html>"
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks for the extra help
0
 
Jaes OverleyConsultantCommented:
No problem. It may not be an issue in this case, but at some point you might need to put quotes in your HTML string within VBA and would need this extra bit of information.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.