Automation email sent with hyperlink

Prathap Mrk

New Member
Joined
Aug 20, 2017
Messages
1
Hi,

I have created the below script to send the n number of auto emails by clicking command button. However I could not insert the hyperlink from cell value.


SCRIPT:

Sub Button1_Click()

Dim o1App As Outlook.Application
Dim o1Mail As MailItem

For r = 2 To 11

Set o1App = CreateObject("outlook.<wbr>Application")
Set o1Mail = o1App.CreateItem(0)

With o1Mail

.To = Cells.Item(15, "Q")
.CC = Cells.Item(16, "Q")
.Subject = "Order Payment" & Cells(r, 10)


Sample = "Hi,"
Sample = Sample & vbCr & vbCr
Sample = Sample & "Please can you approve " & Cells(r, 1) & " Order Payment, Paperwork's can be found at the following links:"
Sample = Sample & vbCr & vbCr
Sample = Sample & "Please include the payment amount when approving. " & vbCr & vbCr
Sample = Sample & "Amount = " & Cells(r, 3)
Sample = Sample & vbCr & vbCr
Sample = Sample & Cells(r, 6)
Sample = Sample & vbCr & vbCr
Sample = Sample & "Notes: Open the above path, match the Total values in " & Cells(r, 4) & ", " & " Order BACS Checklists " & Cells(r, 5) & "' and 'Payments_Summary_Report__GB' "
Signature = Cells.Item(9, "Q") & vbCr & Cells.Item(10, "Q") & vbCr & Cells.Item(11, "Q") & vbCr
Sample = Sample & Signature

.Body = Sample
.Display

End With

Next

Set o1App = Nothing
Set o1Mail = Nothing

End Sub


Here, Cells(r, 6) column are contains the hyperlinks in excel.

While running the above script, it creates a auto emails with the details as I mentioned in the script. But the column of Cells(r, 6) also pasted as text not hyperlink in the body of email.


Please suggest me the correct script to get the cell value as Hyperlink in auto emails.


Thanks,
Prathap Mrk
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.

Forum statistics

Threads
1,223,909
Messages
6,175,314
Members
452,634
Latest member
cpostell

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top