patil prakash
New Member
- Joined
- Dec 3, 2019
- Messages
- 6
- Office Version
- 2010
- Platform
- Windows
Hello Team,
I am new here.
I want to attache pdf file in below code. the pdf link available in cells(i, 14).
could you please help me for solve this query.
Sub SendMultipleEmails()
Dim Mail_Object, OutApp As Variant
With ActiveSheet
lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row
End With
For I = 2 To lastrow
Set Mail_Object = CreateObject("Outlook.Application")
Set OutApp = Mail_Object.CreateItem(0)
With OutApp
.To = Cells(I, 8)
.cc = Cells(I, 10)
.Display
.Subject = "Shipment Delivery Notification"
.htmlbody = "<b>Dear Customer,</b>" & _
"<p>Kind Attn :- ""<b>" & Cells(I, 7) & "</b>" & ", Company - ""<b>" & Cells(I, 5) & "</b>" & _
"<p>Thank you for your recent order ""<b>" & Cells(I, 6) & "</b>" & " to us." & vbNewLine & vbNewLine & _
"<p>We are pleased to inform you that the items listed are now on the way to you." & vbNewLine & _
"<p>Your order has been executed against Sales Order ""<b>" & Cells(I, 1) & "</b>" & ", & Invoiced with ""<b>" & Cells(I, 2) & "</b>" & ", dated ""<b>" & Cells(I, 3) & "</b>" & ". Materials have been shipped to your address through Transporter-""<b>" & Cells(I, 13) & "</b>" & ", against docket no.- ""<b>" & Cells(I, 11) & " </b>" & " dated ""<b>" & Cells(I, 12) & "</b>" & vbNewLine & _
"<p>Your order should reach you within Few days as mentioned in the website of the Transporter." & vbNewLine & _
"<P>It has been a pleasure to serve you, and please do not hesitate to get in touch with the contact person ""<b>" & Cells(I, 9) & "</b>" & " Email:- ""<b>" & Cells(I, 10) & "</b>" & " if the materials are not delivered in time." & vbNewLine & _
"<P>This email is generated by the system - do not reply to this address." & vbNewLine & _
"<P>" & vbNewLine & _
"<p>It has been a pleasure to serve you," & vbNewLine & _
"<P>Again, thank you for choosing our product." & .htmlbody
End With
Next I
debugs:
If Err.Description <> "" Then MsgBox Err.Description
End Sub
I am new here.
I want to attache pdf file in below code. the pdf link available in cells(i, 14).
could you please help me for solve this query.
Sub SendMultipleEmails()
Dim Mail_Object, OutApp As Variant
With ActiveSheet
lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row
End With
For I = 2 To lastrow
Set Mail_Object = CreateObject("Outlook.Application")
Set OutApp = Mail_Object.CreateItem(0)
With OutApp
.To = Cells(I, 8)
.cc = Cells(I, 10)
.Display
.Subject = "Shipment Delivery Notification"
.htmlbody = "<b>Dear Customer,</b>" & _
"<p>Kind Attn :- ""<b>" & Cells(I, 7) & "</b>" & ", Company - ""<b>" & Cells(I, 5) & "</b>" & _
"<p>Thank you for your recent order ""<b>" & Cells(I, 6) & "</b>" & " to us." & vbNewLine & vbNewLine & _
"<p>We are pleased to inform you that the items listed are now on the way to you." & vbNewLine & _
"<p>Your order has been executed against Sales Order ""<b>" & Cells(I, 1) & "</b>" & ", & Invoiced with ""<b>" & Cells(I, 2) & "</b>" & ", dated ""<b>" & Cells(I, 3) & "</b>" & ". Materials have been shipped to your address through Transporter-""<b>" & Cells(I, 13) & "</b>" & ", against docket no.- ""<b>" & Cells(I, 11) & " </b>" & " dated ""<b>" & Cells(I, 12) & "</b>" & vbNewLine & _
"<p>Your order should reach you within Few days as mentioned in the website of the Transporter." & vbNewLine & _
"<P>It has been a pleasure to serve you, and please do not hesitate to get in touch with the contact person ""<b>" & Cells(I, 9) & "</b>" & " Email:- ""<b>" & Cells(I, 10) & "</b>" & " if the materials are not delivered in time." & vbNewLine & _
"<P>This email is generated by the system - do not reply to this address." & vbNewLine & _
"<P>" & vbNewLine & _
"<p>It has been a pleasure to serve you," & vbNewLine & _
"<P>Again, thank you for choosing our product." & .htmlbody
End With
Next I
debugs:
If Err.Description <> "" Then MsgBox Err.Description
End Sub