Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

embed image as background in Outlook

Status
Not open for further replies.

terzaghi

Programmer
Aug 25, 2003
49
0
0
IT
Hi, im'trying to automate the sending of email from excel using Outlook.

I use this macro:

-----------------
' requires a reference to the Microsoft Outlook 8.0 Object Library
Sub SendAnEmailWithOutlook()
' creates and sends a new e-mail message with Outlook
Dim OLF As Outlook.MAPIFolder, olMailItem As Outlook.MailItem
Dim ToContact As Outlook.Recipient
Set OLF = GetObject("", _
"Outlook.Application").GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)
Set olMailItem = OLF.Items.Add ' creates a new e-mail message
With olMailItem
.Subject = "Subject for the new e-mail message" ' message subject
Set ToContact = .Recipients.Add("jhon.doe@aol.com") ' add a recipient
.Body = "Hi!" & Chr(13)
' the message text with a line break
'.Attachments.Add "C:\FolderName\Filename.gif", olByValue, , _
"Attachment" ' insert attachment
.Send ' sends the e-mail message (puts it in the Outbox)
End With
Set ToContact = Nothing
Set olMailItem = Nothing
Set OLF = Nothing
End Sub

----------------

What I want to do is to embed the image Filename.gif as the background of the text instead of an attachment like now.
I don't find the correct syntax.

May annyone halp me pelase?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top