Change body of Outlook e-mail location to hyperlink

tiredofit

Well-known Member
Joined
Apr 11, 2013
Messages
1,148
In Excel, I have created a sub that creates an e-mail in Outlook and adds some text in the body.

In particular, I have text which is a location, such as:

Code:
C:\MyLocation\MyFiles\
The problem is this is displayed simply as text. I want it to be hyperlink.

Can it be done with VBA from Excel?

Thanks
 

Some videos you may like

Excel Facts

Format cells as date
Select range and press Ctrl+Shift+3 to format cells as date. (Shift 3 is the # sign which sort of looks like a small calendar).

tiredofit

Well-known Member
Joined
Apr 11, 2013
Messages
1,148
Found this:

Code:
Dim Fileloc

Fileloc = "C:\MyLocation\MyFiles\"

.HTMLBody = "<a href=h>" & Fileloc & "</a>"
which does indeed turns the text as a hyperlink but when I click on it, it thinks it's a webpage and opens the web browser instead of Windows Explorer.

How can I fix it?
 

Watch MrExcel Video

Forum statistics

Threads
1,095,354
Messages
5,443,962
Members
405,257
Latest member
daveyf

This Week's Hot Topics

Top