Solved

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

Posted on 2010-11-26
2
293 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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

I would like to show you some basics you can do with Mailings in MS Word. It´s quite handy feature you can use for creating envelopes, labels, personalized letters etc. First question could be what is this feature good for? Mailing can really he…
This code takes an Excel list of URL’s and adds a header titled “URL List”. It then searches through all URL’s in column “A”, looking for duplicates. When a duplicate is found, it is moved to the top of the list. The duplicate URL’s are then highlig…
This Micro Tutorial demonstrate the bugs in Microsoft Excel for Mac with Pivot Charts.
This Micro Tutorial will demonstrate on a Mac how to change the sort order for chart legend values and decrpyt the intimidating chart menu.

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now