How can I embed a photo at the end of an email?
Application.ScreenUpdating = False
Set OutApp = CreateObject("Outlook.Application")
On Error GoTo cleanup
For Each cell In Columns("B").Cells.SpecialCells(xlCellTypeConstants)
If cell.Value Like "?*@?*.?*" And _
LCase(Cells(cell.Row, "C").Value) = "yes" Then
Set OutMail = OutApp.CreateItem(0)
On Error Resume Next
With OutMail
.Display
End With
signature = OutMail.body
With OutMail
.To = cell.Value
.CC = "xxxxx@gmail.com; xxxxxx@hotmail.com"
.Subject = "Hello"
.body = "Dear " & Cells(cell.Row, "A").Value _
& vbNewLine & _
vbNewLine & _
vbNewLine & _
"Body" & _
signature
sourcefile = "XXXXXXX"
sourcefile1 = "XXXXXX"
.Attachments.Add sourcefile
.Attachments.Add sourcefile1
.Send
End With
Set OMail = Nothing
Set OApp = Nothing
On Error GoTo 0
Set OutMail = Nothing
End If
Next cell
cleanup:
Set OutApp = Nothing
Application.ScreenUpdating = True
End Sub
The code works.
I would like to embed a Xmas image (JPEG). I have done a dig around the internet however am unable to figure it out what command function I can use to embed it.