I am trying to send an email via Outlook from within a VB6 program. Everything is working fine so far, and my emails get sent successfully. I would like to send the recipient a link in the body of the email, however, that sends them to a network directory. I can't seem to get a hyperlink in the body of the email.
My code for sending the email thus far looks like this:
Dim outlookApp As Outlook.Application
Dim resultsEmail As Outlook.MailItem
Set outlookApp = CreateObject("Outlook.Application")
Set resultsEmail = Outlook.CreateItem(olMailItem)
With resultsEmail
.To = addressee
.Subject = emailSubject
.Body = "Results are available here: " & 'somehow put in a hyperlink
.Send
End With
addressee and emailSubject are just strings created earlier in the code.
I tried inserting an HTML link using VB6's horrific quote escapes, hoping Outlook would magically sort it out:
"<a href" & ch=" & chr(34) & "directoryLocation" & chr(34) & ">Link text</a>"
But it doesn't create the hyperlink, it just puts the resulting text in the body of the email:
<a href="url">Link text</a>
How can I get a link in the generated email?