Solved

Excel VBA - Outlook Html body hyperlink

Posted on 2014-04-08
6
2,056 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
  • 2
  • 2
  • 2
6 Comments
 
LVL 39

Expert Comment

by:Pratima Pharande
Comment Utility
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
Comment Utility
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
Comment Utility
Thanks very much
0
6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

 
LVL 1

Expert Comment

by:Jaes Overley
Comment Utility
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
Comment Utility
Thanks for the extra help
0
 
LVL 1

Expert Comment

by:Jaes Overley
Comment Utility
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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Earnings Spreadsheet in Excel 3 37
Index & Match Help 2 22
Excel VBA - UserForm control click 12 35
Add macros on Open 4 21
Convert between Excel file formats (.XLS, .XLSX, .XLSM) with/without macro option David Miller (dlmille) Intro Over this past Fall, I've had the opportunity to see several similar requests and have developed a couple related solutions associate…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

762 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

9 Experts available now in Live!

Get 1:1 Help Now