ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Images in outlook e-mails. (https://www.excelbanter.com/excel-programming/433962-images-outlook-e-mails.html)

ben

Images in outlook e-mails.
 
I am trying to create a newsletter type macro that allows us to send
flyers/sales out to a customer list. Creating the e-mails, adding
attachments, adding recipients has been accomplished with no problem. Now I
am having an issue adding pictures to an e-mail.

I am trying to copy the "insert-picture from file" functionality when you
are creating an outlook message. I recorded a macro when doing so and
received the following line

Selection.InlineShapes.AddPicture Filename:="C:\b&w.jpg", LinkToFile:= _
False, SaveWithDocument:=True

Turns out that I'm using Word as my e-mail editor and that is a Word command
and can't be used with..

Dim oOutlook As Object
Dim oMailItem As Object
Dim oRecipient As Object
Dim oNameSpace As Object
Set oOutlook = CreateObject("Outlook.Application")
Set oNameSpace = oOutlook.GetNameSpace("MAPI")
oNameSpace.Logon , , True
For u = 1 To 1
Set oMailItem = oOutlook.CreateItem(0)
Set oRecipient = _
")
oRecipient.Type = 1 '1 = To, use 2 for cc
'keep repeating these lines with
'your names, adding to the collection.
With oMailItem
..Subject = "Tux - Test"
..Body = bstr
'.InlineShapes.AddPicture Filename:="C:\b&w.jpg", LinkToFile:= _
False, SaveWithDocument:=True
..display
End With

Does anyone know the best way to do this?



--
When you lose your mind, you free your life.


joel

Images in outlook e-mails.
 
See Ron Debruin website for sending email. the body of the email needs to be
HTML and you have to save the picture into a HTML file and then import that
picture into the word/email document

www.Rondebruin.com

"ben" wrote:

I am trying to create a newsletter type macro that allows us to send
flyers/sales out to a customer list. Creating the e-mails, adding
attachments, adding recipients has been accomplished with no problem. Now I
am having an issue adding pictures to an e-mail.

I am trying to copy the "insert-picture from file" functionality when you
are creating an outlook message. I recorded a macro when doing so and
received the following line

Selection.InlineShapes.AddPicture Filename:="C:\b&w.jpg", LinkToFile:= _
False, SaveWithDocument:=True

Turns out that I'm using Word as my e-mail editor and that is a Word command
and can't be used with..

Dim oOutlook As Object
Dim oMailItem As Object
Dim oRecipient As Object
Dim oNameSpace As Object
Set oOutlook = CreateObject("Outlook.Application")
Set oNameSpace = oOutlook.GetNameSpace("MAPI")
oNameSpace.Logon , , True
For u = 1 To 1
Set oMailItem = oOutlook.CreateItem(0)
Set oRecipient = _
")
oRecipient.Type = 1 '1 = To, use 2 for cc
'keep repeating these lines with
'your names, adding to the collection.
With oMailItem
.Subject = "Tux - Test"
.Body = bstr
'.InlineShapes.AddPicture Filename:="C:\b&w.jpg", LinkToFile:= _
False, SaveWithDocument:=True
.display
End With

Does anyone know the best way to do this?



--
When you lose your mind, you free your life.


Ron de Bruin

Images in outlook e-mails.
 
Hi Joel

It is .nl <g
http://www.rondebruin.nl/tips.htm

For the OP

Try this example
http://www.rondebruin.nl/mail/folder3/mailenvelope.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Joel" wrote in message ...
See Ron Debruin website for sending email. the body of the email needs to be
HTML and you have to save the picture into a HTML file and then import that
picture into the word/email document

www.Rondebruin.com

"ben" wrote:

I am trying to create a newsletter type macro that allows us to send
flyers/sales out to a customer list. Creating the e-mails, adding
attachments, adding recipients has been accomplished with no problem. Now I
am having an issue adding pictures to an e-mail.

I am trying to copy the "insert-picture from file" functionality when you
are creating an outlook message. I recorded a macro when doing so and
received the following line

Selection.InlineShapes.AddPicture Filename:="C:\b&w.jpg", LinkToFile:= _
False, SaveWithDocument:=True

Turns out that I'm using Word as my e-mail editor and that is a Word command
and can't be used with..

Dim oOutlook As Object
Dim oMailItem As Object
Dim oRecipient As Object
Dim oNameSpace As Object
Set oOutlook = CreateObject("Outlook.Application")
Set oNameSpace = oOutlook.GetNameSpace("MAPI")
oNameSpace.Logon , , True
For u = 1 To 1
Set oMailItem = oOutlook.CreateItem(0)
Set oRecipient = _
")
oRecipient.Type = 1 '1 = To, use 2 for cc
'keep repeating these lines with
'your names, adding to the collection.
With oMailItem
.Subject = "Tux - Test"
.Body = bstr
'.InlineShapes.AddPicture Filename:="C:\b&w.jpg", LinkToFile:= _
False, SaveWithDocument:=True
.display
End With

Does anyone know the best way to do this?



--
When you lose your mind, you free your life.


ben

Images in outlook e-mails.
 
Thank you. :)

I also found a way to do it using Redemption and CDO from outlook



--
When you lose your mind, you free your life.



"Joel" wrote:

See Ron Debruin website for sending email. the body of the email needs to be
HTML and you have to save the picture into a HTML file and then import that
picture into the word/email document

www.Rondebruin.com

"ben" wrote:

I am trying to create a newsletter type macro that allows us to send
flyers/sales out to a customer list. Creating the e-mails, adding
attachments, adding recipients has been accomplished with no problem. Now I
am having an issue adding pictures to an e-mail.

I am trying to copy the "insert-picture from file" functionality when you
are creating an outlook message. I recorded a macro when doing so and
received the following line

Selection.InlineShapes.AddPicture Filename:="C:\b&w.jpg", LinkToFile:= _
False, SaveWithDocument:=True

Turns out that I'm using Word as my e-mail editor and that is a Word command
and can't be used with..

Dim oOutlook As Object
Dim oMailItem As Object
Dim oRecipient As Object
Dim oNameSpace As Object
Set oOutlook = CreateObject("Outlook.Application")
Set oNameSpace = oOutlook.GetNameSpace("MAPI")
oNameSpace.Logon , , True
For u = 1 To 1
Set oMailItem = oOutlook.CreateItem(0)
Set oRecipient = _
")
oRecipient.Type = 1 '1 = To, use 2 for cc
'keep repeating these lines with
'your names, adding to the collection.
With oMailItem
.Subject = "Tux - Test"
.Body = bstr
'.InlineShapes.AddPicture Filename:="C:\b&w.jpg", LinkToFile:= _
False, SaveWithDocument:=True
.display
End With

Does anyone know the best way to do this?



--
When you lose your mind, you free your life.



All times are GMT +1. The time now is 12:47 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com