HTML format email with hyperlink (1 Viewer)

pgadsby

New member
Local time
Today, 16:46
Joined
Aug 18, 2014
Messages
2
Hello

I am using the following vba code to create and send an html format email message. The key information in the email is a hyperlink to a network drive folder location using [Directory] as a hyperlink table value to get the address that is stored like this:
K:\Pipelines\P9 - TEP Products\MOP AID-1500\Final Approved

The email hyperlink that is produced looks like this:
#K:\Pipelines\P9_-_TEP_Products\MOP_AID-

Dim appOutLook As Outlook.Application
Dim MailOutLook As Outlook.MailItem
Dim MOPVDB As String
MOPVDB = "H:\PGADSBY\MOP VALIDATION\TRACKING\MOPVDB\MOP Validation DatabaseFE.accdb"
Set appOutLook = CreateObject("Outlook.Application")
Set MailOutLook = appOutLook.CreateItem(olMailItem)
Dim StrBody As String
StrBody = "The subject MOP validation is ready for Management review and is located " _
& "<a href=""" & [Directory] & """> in this folder </a>" & " or through the " _
& "<a href=""" & MOPVDB & """> MOP validation database</a>"
With MailOutLook
.BodyFormat = olFormatHTML
.To = MGT_REVIEW
.CC = ENG_REVIEW
.BCC = SUPERVISOR & ";" & QA_REVIEW
.Subject = "MOP Validation for LID-" & LID & " AID-" & AID & " (" & [CATEGORY] & ")"
.HTMLBody = StrBody
.Display
'.Send
End With
Me.Refresh
Bailout:
End Sub

Thanks for your help, Pete
 

vbaInet

AWF VIP
Local time
Today, 22:46
Joined
Jan 22, 2010
Messages
26,374
Try:
Code:
StrBody = "The subject MOP validation is ready for Management review and is located " _
 & "<a href='" & [Directory] & "'>in this folder</a>" & " or through the " _
 & "<a href='" & MOPVDB & "'>MOP validation database</a>"
 

Users who are viewing this thread

Top Bottom