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
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