Since Natarajan has shown you how to read an .html file, I'll tackle the
Excel issue:
Sub GetExcelCellRangeAndPasteIntoCurrentMessage()
Dim objExcel As New Excel.Application, objBook As Excel.Workbook
Dim objCurMsg As Outlook.MailItem, objCBC As Office.CommandBarControl
Set objBook = objExcel.Workbooks.Open("C:\Documents and
Settings\elegault\Desktop\Book1.xls")
objBook.Sheets(1).Range("A1:H20").Select
objBook.Sheets(1).Range("A1:H20").Copy
Set objCurMsg = Application.ActiveInspector.CurrentItem
Set objCBC = Application.ActiveInspector.CommandBars.FindControl(, 22)
Application.ActiveInspector.Activate
SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys "{TAB}", True
objCBC.Execute 'OR YOU CAN USE SendKeys "^{V}"
objExcel.DisplayAlerts = False 'DISABLES THE ANNOYING "RETAIN CLIPBOARD
DATA?" MESSAGE
objBook.Close False
objExcel.Quit
Set objBook = Nothing
Set objExcel = Nothing
End Sub
--
Eric Legault, MCSD
ADAPSYS - http://www.adapsys.ca
Quote:
> Hi All,
> I'm new to the Outlook forum, do most of my work with excel. I started
> searching here for the answer to a problem I'm having sending an e-mail
from
> excel. I see that I'm not alone, many people with the same problem! Since
I
> do not wish to compromise my Outlook security, I have a question about
> working around this problem!!!
> Is it possible to create a macro in Outlook(2002) that will either copy
and
> paste or take cells from a excel worksheet cells(A1 to H20) and place them
> in the message body, or open an htm file and copy it's contents into the
> message body?
> Thanks in Advance
> Craig