Solved

Excel VBA - Outlook Html body hyperlink

Posted on 2014-04-08
6
2,359 Views
Last Modified: 2014-07-10
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>"
0
Comment
Question by:murbro
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 39

Expert Comment

by:Pratima Pharande
ID: 39985269
oMsg.HTMLBody = "<html><body><font size=3  color=red>Automated invoicing powered by <a>www.online-excel.co.za</a></font></body></html>"
0
 
LVL 39

Accepted Solution

by:
Pratima Pharande earned 500 total points
ID: 39985273
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
 

Author Closing Comment

by:murbro
ID: 39985293
Thanks very much
0
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 1

Expert Comment

by:Jaes Overley
ID: 40188677
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
 

Author Comment

by:murbro
ID: 40188941
Thanks for the extra help
0
 
LVL 1

Expert Comment

by:Jaes Overley
ID: 40188957
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

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This article describes how you can use Custom Document Properties to store settings and other information in your workbook so that they will be available the next time you open the workbook.
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.

726 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