VBA how to embed an image in an email body

jaxneng

New Member
Joined
May 14, 2013
Messages
14
Hi,

I have a code to send an email (which works ok) but I need help embedding an image into the body of this email. The image needs to be from range (a2,k37).

any help is appreciate, thank you!

see email code below (which I sourced from this forum...thank you very much):
************
Sub sendmail3()

Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String

If ActiveWorkbook.Path <> "" Then
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)

strbody = "<font size=""3"" face=""Calibri"">" & _
"This ECO is now APPROVED" & _
"<br><br>" & Range("a60").Value & _
"<br><br>" & Range("a61").Value & _
"<br><br>" & Range("a62").Value & _
"<br><br>" & Range("a63").Value & _
"<br><br>Click on this link to open the file : " & _
"<A HREF=""file://" & ActiveWorkbook.FullName & _
""">Link to the file</A>" & _
"<br><br>Regards,<br>" & _
"CM" & _
"<br>NF Dept</font>"

On Error Resume Next
With OutMail
.To = Range("b77").Value
.cc = Range("b78").Value
.BCC = ""
.Subject = ActiveWorkbook.Name & "_Tooling ECO - APPROVED " & Range("a57").Value
.HTMLBody = strbody
.Display 'or use .Send
End With
On Error GoTo 0

Set OutMail = Nothing
Set OutApp = Nothing
Else
MsgBox "The ActiveWorkbook does not have a path, Save the file first."
End If
End Sub
************
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.

Forum statistics

Threads
1,223,903
Messages
6,175,279
Members
452,630
Latest member
OdubiYouth

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