AccountantHarry
New Member
- Joined
- Oct 13, 2019
- Messages
- 18
Hi
I have a macro which I wrote from watching a couple of YouTube videos, it works however, I would like to add the company logo at the bottom of the email, the image is saved in W:\company\logo.jpg. My codes are as follows:
Sub send_email_with_attachments()
On Error Resume Next
Dim o As Outlook.Application
Set o = New Outlook.Application
Dim omail As Outlook.MailItem
Dim i As Long
For i = 13 To Sheet1.Cells(Rows.Count, 1).End(xlUp).Row
Set omail = o.CreateItem(olMailItem)
With omail
.To = Cells(i, 1).Value
.CC = Cells(i, 2).Value
.Subject = Cells(i, 3).Value
.Body = "Hi " & Cells(i, 4).Value & vbNewLine & vbNewLine & Cells(i, 5).Value & vbNewLine & vbNewLine & Cells(i, 6).Value & "Kind regards" & vbNewLine & "Harriet"
.Attachments.Add Cells(i, 7).Value
.Attachments.Add Cells(i, 8).Value
.Attachments.Add Cells(i, 9).Value
.Display
End With
Next
End Sub
Please help.
I have a macro which I wrote from watching a couple of YouTube videos, it works however, I would like to add the company logo at the bottom of the email, the image is saved in W:\company\logo.jpg. My codes are as follows:
Sub send_email_with_attachments()
On Error Resume Next
Dim o As Outlook.Application
Set o = New Outlook.Application
Dim omail As Outlook.MailItem
Dim i As Long
For i = 13 To Sheet1.Cells(Rows.Count, 1).End(xlUp).Row
Set omail = o.CreateItem(olMailItem)
With omail
.To = Cells(i, 1).Value
.CC = Cells(i, 2).Value
.Subject = Cells(i, 3).Value
.Body = "Hi " & Cells(i, 4).Value & vbNewLine & vbNewLine & Cells(i, 5).Value & vbNewLine & vbNewLine & Cells(i, 6).Value & "Kind regards" & vbNewLine & "Harriet"
.Attachments.Add Cells(i, 7).Value
.Attachments.Add Cells(i, 8).Value
.Attachments.Add Cells(i, 9).Value
.Display
End With
Next
End Sub
Please help.
Last edited: