View Single Post
  #2  
Old January 31st 07, 06:56 AM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default HTMLBody with images


Here's a sample, based on a template from Dmitry Streblchenko:
http://www.vboffice.net/sample.html?...9&cmd=showitem

For that sample you need the Redemption (www.dimastr.com).

Call AddEmbeddedAttachment with

- Mail: Outlook MailItem
- File: Full file name of the image file
- [PositionID]: You can insert a placeholder into the e-mails HTMLBody and
pass that placeholder here. The image then would be placed at that position.
If there's no placeholder the image would be inserted at the end.
- [Description]: Optional description for the image


--
Viele Gruesse / Best regards
Michael Bauer - MVP Outlook
Keep your Outlook categories organized!
http://www.shareit.com/product.html?...4&languageid=1
(German: http://www.VBOffice.net/product.html?pub=6)


Am Tue, 30 Jan 2007 16:44:00 -0800 schrieb Tim Johnson:

Hi there,

I am working on the development of a database (Access). I think that
because the issues I'm having are outlook related, though, that this is

the
appropriate place for posting this.

I use a VBA sub to create an instance of Outlook by which I send
"personalized" emails. Most of these emails are designed using Word and
include images, then are saved as HTML files. My code is currently:

Set FSO = CreateObject("Scripting.FileSystemObject")
Set bdy = FSO.OpenTextFile(strFile,1)
strText = bdy.readall

With objMail
.To = strTo
.Subject = strSubject
.HTMLBody = strText
.Send
End With

The email's body & formatting come through just fine, but the images are
broken links (it appears from the source as though they're tring to link

to a
local location).

Is there a way to include the images without having to post them on the
internet each time?

Thanks in advance

Ads