Currently i have the coding to email out okay. What i am after is a way to attach the hyperlink that has been added in the second column:
Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Sub SendEMail()
Dim Email As String, Subj As String
Dim Msg As String, URL As String
Email = Cells(ActiveCell.Row, 7)
Subj = Cells(ActiveCell.Row, 4) & " " & Cells(ActiveCell.Row, 2)
Msg = ""
Msg = Msg & "Dear " & Cells(ActiveCell.Row, 3) & "," & vbCrLf & vbCrLf & "This is a reminder that an incident report review/upate is required " & vbCrLf & vbCrLf & Cells(ActiveCell.Row, 8) & vbCrLf & vbCrLf & " If the above has been completed, please inform Admin so the details can be updated. Thank you. "
'Replace spaces with %20 (hex)
Subj = Application.WorksheetFunction.Substitute(Subj, " ", "%20")
Msg = Application.WorksheetFunction.Substitute(Msg, " ", "%20")
'Replace carriage returns with %0D%0A (hex)
Msg = Application.WorksheetFunction.Substitute(Msg, vbCrLf, "%0D%0A")
'Create the URL
URL = "mailto:" & Email & "?subject=" & Subj & "&body=" & Msg
'Execute the URL (start the email client)
ShellExecute 0&, vbNullString, URL, vbNullString, vbNullString, vbNormalFocus
'Wait two seconds before sending keystrokes
'Application.Wait (Now + TimeValue("0:00:02"))
'Application.SendKeys "%s"
End Sub
Where highlighted Red in the subject line - i would like it to add the cell reference as a link not just the text.
Bookmarks