I have the following code which works fine to call an email
Code
Private Sub ClosedButton1_Click()
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
strbody = "Dear " & Cells(15, 20) & "," & vbNewLine & vbNewLine & _
"Please note that I have applied for leave on my leave card." & vbNewLine & _
"I would be grateful if this could be considered." & vbNewLine & _
TextBox6.Value & vbNewLine & _
"My Leave card can be found here:- " & Range("T22") & vbNewLine & vbNewLine & "" & _
"I look forward to your response." & vbNewLine & vbNewLine & _
"Many thanks, " & Cells(3, 3) & vbNewLine & vbNewLine & _
"(CC:'d to individual - if Line Manager not available please forward to person deputising)"
On Error Resume Next
With OutMail
.To = Cells(16, 20)
.CC = Cells(17, 20)
.BCC = ""
.Subject = "Application for leave"
.Body = strbody
'You can add a file like this
'.Attachments.Add ("C:\test.txt")
.Display 'or use .Send
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
Unload Me
End Sub
Display More
What I need to do (I can't get to work!) is get "Range("T22")" to become an active hyperlink within the email body; all it does it copy the text and not the hyperlink which is in cell T22.
Help!