Hello,
I've added some VBA to an Excel workbook to allow it to be automatically sent for approval. I use VBA to create an Outlook message informing the approver that they need to approve the new item.
Instead of sending the form as an attachment, I need to send a link to where it is stored but I am having problems adding the hyperlink to the file's location in the outlook message. Here is my code:
The HTML does not recognise the VBA string (obviously) but I don't know how to pass the hyperlink into the body of the message.
Can anyone help me?
Thanks,
David
I've added some VBA to an Excel workbook to allow it to be automatically sent for approval. I use VBA to create an Outlook message informing the approver that they need to approve the new item.
Instead of sending the form as an attachment, I need to send a link to where it is stored but I am having problems adding the hyperlink to the file's location in the outlook message. Here is my code:
Code:
strDesignNotePathname = Sheet3.[DNPath]
Set objMail As New Outlook.MailItem
With objMail
.To = strApprover
.Subject = "Design Note for Approval - " & Sheet8.Range("DN_Number")
.Display
.BodyFormat = olFormatHTML
.HTMLBody = "<html><body><p>Please review and action the following <a href=[COLOR=red]strDesignNotePathname[/color]>Design Note</a></p></body></html>"
'.ReadReceiptRequested = True
If dteReleaseDate <> #12:00:00 AM# Then
.FlagStatus = olFlagMarked
.FlagDueBy = dteReleaseDate
End If
End With
The HTML does not recognise the VBA string (obviously) but I don't know how to pass the hyperlink into the body of the message.
Can anyone help me?
Thanks,
David