![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
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 |
#2
|
|||
|
|||
![]()
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 -- Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.) Try Picture Attachments Wizard for Outlook: http://www.collaborativeinnovations.ca Blog: http://blogs.officezealot.com/legault/ "Alessandro Plasmati" wrote: 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Outlook + Excel | dspilberg | Outlook and VBA | 2 | April 18th 07 02:06 PM |
Outlook and Excel | Laura Stevens | Outlook - Using Forms | 1 | March 10th 07 02:31 PM |
Excel & Outlook | Lumpjaw | Outlook - General Queries | 3 | November 3rd 06 04:03 AM |
importing from excel to outlook | Sheila | Outlook - Using Contacts | 1 | October 14th 06 06:36 AM |
Outlook to Excel | rfrancis | Outlook and VBA | 2 | March 27th 06 03:20 PM |