Excel and Outlook

  • Thread starter Alessandro Plasmati
  • Start date
A

Alessandro Plasmati

Hi all,

I am trying to automate the following procedure, but I have no clue as
how to do it.


Could you please advise?


I have a spreadsheet, and I want to copy the contents of a Range, WITH
formatting and Images, and paste them into an HTML Email on Outlook.


I have tried with the following Sub

Sub Justins_New_Macro()
Dim myOlApp As Object
Dim newItem As Object
Set myOlApp = CreateObject("Outlook.Application")
Set newItem = myOlApp.CreateItem(olMailItem)
newItem.HTMLBody = RangetoHTML(Range("css"))
newItem.Display
End Sub

and the RangetoHTML function....

Everything works, except for the images and the hyperlinks in the
cells...anyone knows why and how to get this sorted?

Thanks a lot

Alessandro
 
E

Eric Legault [MVP - Outlook]

It looks like that RangeToHTML function is a custom one:
http://www.dicks-clicks.com/excel/sheettohtml.htm

If you need to redo the HTML to properly format any existing URLs or images
in the spreadsheet, that's entirely up to you and nothing in the Outlook
Object Model can help you. However, there is a technique for constructing
the proper HTML that uses inline images:

To add an embedded image to an HTML message in Microsoft Outlook using code:
http://www.outlookcode.com/d/code/htmlimg.htm
 

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