Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA MailItem Hyperlink

Status
Not open for further replies.

mfma82

Programmer
May 9, 2012
2
US
Hi,

I have been trying to use the MailItem propery to send an email to outlook 2010.

I have the following snipit of code -

Code:
        MyMail.Body = MyBodyText
        MyMail.BodyFormat = olFormatHTML
        Hyperlink = MailList("Hyperlink")
        MyMail.Body = Replace(MyMail.Body, "myid" & myID, "file:" & Hyperlink)

The hyperlink is appearing in my email but it displays as - file:\\reese\data\FieldReports\OCG\Test\TAA\Current and links to \\reese\data\FieldReports\OCG\Test\TAA\Current

Does anyone know how I can remove the file: from the display link? If I remove it from my code the text appears but it is not a hyperlink.

Thanks!
 
The "file" has to be there to display it as a hyperlink if the link is to something on your local file server. It tells windows to use the default program that created the file to open the file instead of displaying it in a browser window. Is this what you are intending to do?

 
Yes, but if i go outlook and just highlight text and make it a link my display text does not have file: in front of it but the link does.

I tried for hours but cannot figure out how to not have file: in the display text via VBA.

Thoughts?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top