WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

OLE and Outlook
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Embed an Image into an Outlook Email


Trick to embed a graphic into an Outlook email message.
Recip = "fred@flinstone.com"
pic = "C:\Documents and Settings\userprof\My Documents\My Pictures\Heart55.jpg"
olMailItem = 0
objOL = CreateObject("Outlook.Application")
objMail = objOL.CreateItem(olMailItem)

; add Recipient
objOutlookRecip=objMail.Recipients
objOutlookRecip.Add(Recip)

; Set the Subject, Body,
objMail.Subject = "This is an Automation test with Microsoft Outlook"

; set body of message with embedded graphic
objMail.Attachments.Add( pic )
objMail.HTMLBody = StrCat("<html><p>This is a picture.</p> <img src='cid:",FileRoot( pic ),".",FileExtension( pic ),"' height=480 width=360>")
objMail.Display()

objMail.Send

Exit


Article ID:   W17123
File Created: 2007:07:03:14:28:24
Last Updated: 2007:07:03:14:28:24