Good Afternoon All,
I have some VBA that sends an e-mail based on an address in a spreadsheet. It also sends a link to a survey form. My quetion is how do I convert the link to something like 'Click Here'? Each recipient gets a different link based on their customer number. The current link 'lives' in cell F. It is included in the Body.
Here's the code to send the e-mail and configure the body:
Thanks in Advance,
Sam
I have some VBA that sends an e-mail based on an address in a spreadsheet. It also sends a link to a survey form. My quetion is how do I convert the link to something like 'Click Here'? Each recipient gets a different link based on their customer number. The current link 'lives' in cell F. It is included in the Body.
Here's the code to send the e-mail and configure the body:
Code:
Sub SendEmail_Click()
'Create variables
Dim OutApp As Object
Dim OutMail As Object
Dim AW As Worksheet
Dim i As Integer
Dim Greeting As String
Set AW = ActiveSheet
On Error GoTo cleanup
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
With Application
.EnableEvents = False
.ScreenUpdating = False
End With
Do
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
'Create email
Greeting = "Please respond to our survey"
With OutMail
.To = AW.Range("C" & i).Value
.Subject = AW.Range("D" & i).Value
.Body = Greeting & vbNewLine & _
AW.Range("F" & i).Value & vbNewLine
'Send the e-mail
.Send
End With
i = i + 1
Loop Until IsEmpty(Cells(i, 1))
On Error GoTo 0
Set OutMail = Nothing
AW.AutoFilterMode = False
cleanup:
Set OutApp = Nothing
With Application
.EnableEvents = True
.ScreenUpdating = True
End With
End Sub
Thanks in Advance,
Sam