A Microsoft Outlook email forum. Outlook Banter

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.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Excel and Outlook



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 12th 07, 11:00 AM posted to microsoft.public.outlook.program_vba
Alessandro Plasmati
external usenet poster
 
Posts: 1
Default Excel and Outlook

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  
Old July 12th 07, 05:26 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default Excel and 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

--
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
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
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


All times are GMT +1. The time now is 06:39 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.