Solved

How can I code in Excel VBA for a picture to be emailed?

Posted on 2010-11-26
2
315 Views
Last Modified: 2012-05-10
In Excel, I have written a macro that creates an email (pre-populated with the person in the "To" field, the "BCC" field, the "Subject" field, and some simple text in the message body area).

However, I do not know how to get a picture pre-populated into the message body area.

Any ideas?
0
Comment
Question by:HaimD
2 Comments
 
LVL 37

Accepted Solution

by:
TommySzalapski earned 500 total points
ID: 34219230
Of course you can't do it in a plain text email. So you'll be using .HTMLBODY not .Body. Something like this should work. It will embed when it sends.
.HTMLBODY = "<HTML><Head></Head><Body>Text goes here.<br><img SRC=C:\ImagePath\Imagename.jpg><br>More text here.</Body></HTML>"
0
 
LVL 12

Expert Comment

by:sstampf
ID: 34225768
If you are planning to insert a chart as picture and you are using Outlook you may try the link below:
http://www.rondebruin.nl/mail/folder2/chart.htm

I also got the code below which might can be useful to you (source: http://www.codeforexcelandoutlook.com/excel-vba/send-email-from-excel/)
.HTMLBody = "<BODY><FONT face=Arial color=#000080 size=2></FONT>" & _
            "<IMG alt='' hspace=0 src='cid:EmailTemp.gif' align=baseline 0rder=0>&nbsp;" & _
            "<br><br>Plus add any text you want</BODY>"

Open in new window

0

Featured Post

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
I need help with an EXCEL Nested formula. 5 21
Excel formula to report date modified 14 24
Excel Macro 9 18
Strategy Mapping Excel WB/WS 2 26
A few years ago I was very much a beginner at VBA, and that very much remains the case today.  I'll do my best to explain things as I go in the hope that other beginners can follow.  If you just want to check out a tool that creates a Select Case fu…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.
This Micro Tutorial will demonstrate how to use longer labels with horizontal bar charts instead of the vertical column chart.
This Micro Tutorial well show you how to find and replace special characters in Microsoft Word. This is similar to carriage returns to convert columns of values from Microsoft Excel into comma separated lists.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question