insert picture in email message

H

H.A. de Wilde

I use the following code to create an email from my VBA-project within
Excel.
All lines work fine except:

objMail.InlineShapes.AddPicture Filename:= _
"E:\DisLogo.bmp", LinkToFile:=False, _
SaveWithDocument:=True

Does anyone know how to write this line ?


Dim objMail As Object
Dim objOL As Object

On Error Resume Next
Set objOL = GetObject(, "Outlook.Application")
On Error GoTo 0
If objOL Is Nothing Then
Set objOL = CreateObject("Outlook.Application")
End If
Set objMail = objOL.CreateItem(0)
objMail.To = "(e-mail address removed)"
objMail.Body = "myText"
objMail.Subject = "mySubject"
objMail.InlineShapes.AddPicture Filename:= _
"E:\DisLogo.bmp", LinkToFile:=False, _
SaveWithDocument:=True
objMail.Display

thanks in advance
hugo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top