I have an Excel VBA module that sends an email that includes a hyperlink to a network drive location (that may have spaces). I have some code that sort of works but needs a bit of help...
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
strbody = managername & "," & vbNewLine & vbNewLine & _
"Data has been dumped from the survey controller on project number " & newjob & ". The name of the file is: " & vbNewLine & vbNewLine & _
filefromname & vbNewLine & vbNewLine & _
"and it is located in the following folder:" & vbNewLine & vbNewLine & _
"<a href=""<file:///" & GetFolder & ">"">" & GetFolder & "</a>" & vbNewLine & vbNewLine & _
"Comments:" & vbNewLine & surveynotes
On Error Resume Next
.To = manageremail
.Subject = "Some survey points have been downloaded on one of your projects"
.Body = strbody
'You can add a file like this
.Send 'or use .Display
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
The email sends no problem, and the extra chevrons in the string help me pick folders that have spaces in them. But when the user gets the email, they see the hyperlink source code in the Outlook email like this: (PS - the link works no problem)
instead of seeing it neatly like this:
If I grab the "strbody" variable and paste it into dreamweaver or some other editor, it looks fine, but when the Outlook email is received, the HTML code for the link shows up. What can I do so that the user doesn't see all the <a href> text that goes with the hyperlink?
Thanks very much!