Clean up File Link

B

brittonsm

Worked perferctly, BUT... It's ugly in the email, how do I clean it
up like an href type of link so that I can say maybe

click this "link" to access the file. and the "link" have the file:///
reference hidden in it?

Thanks....

Sub SendMessage()
Dim objOutlook As Outlook.Application
Dim objOutlookMsg As Outlook.MailItem
Dim objOutlookRecip As Outlook.Recipient
Dim strDirectory As String
Dim strFileName As String

strDirectory = "W:\purprod\public\Ellis\2008%20Tracking
%20Tools\PPV%20POs%20Top%2010\"
strFileName = "PPV%20Report%20Forward%20Looking%20" &
Format(Date, "mm-dd-yy") & ".xls"

' Create the Outlook session.
Set objOutlook = CreateObject("Outlook.Application")

' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)

With objOutlookMsg
' Add the To recipient(s) to the message.
Set objOutlookRecip = .Recipients.Add("Britton, Steve")
objOutlookRecip.Type = olTo
.Subject = "This is an Automation test with Microsoft
Outlook"
.Body = "This is the body of the message." & vbCrLf &
vbCrLf & "<file:///" & strDirectory & strFileName & ">"
End With
 
K

Ken Slovak - [MVP - Outlook]

To do that you need to use HTMLBody and not Body and to format your new text
correctly as HTML text using an <A> set of tags. Study some HTML messages
that have text showing for an URL link and see how they do it.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top