ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   hyperlink in email (https://www.excelbanter.com/excel-programming/273845-hyperlink-email.html)

Nelson[_3_]

hyperlink in email
 
Helllo, I am using the code below to send email from
Excel. I can't figure out how to inlcude a hyperlink.
TIA...

Public Sub Send_Email()
Dim olApp As Outlook.Application
Dim olNs As Outlook.NameSpace
Dim olMail As Outlook.MailItem
Dim i As Byte
Dim emailBody As String

Set olApp = CreateObject("Outlook.Application")
Set olNs = olApp.GetNamespace("MAPI")
olNs.Logon
Set olMail = olApp.CreateItem(olMailItem)

With olMail
For i = 1 To Range("Email_List1").Rows.Count
.Recipients.Add Range("Email_List1")(i)
Next i
.Subject = ActiveWorkbook.Name
'
'Build email body
'
If (pubNewReqs = True) Then
emailBody = pubNewReqCnt - 1 & " Regulatory
Requirements have been added for " & Range
("Regs_For").Value & "."
Else
emailBody = Range("Regs_For").Value
& "Regulatory Requirements have been updated."
End If
.Body = emailBody

.Links.Add = "Network or URL path to file"

.OriginatorDeliveryReportRequested = False
.ReadReceiptRequested = False
.Recipients.ResolveAll
.Send
End With

Set olNs = Nothing
Set olApp = Nothing
Set olMail = Nothing
End Sub



All times are GMT +1. The time now is 04:00 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com