Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
email multiple worksheets
I am using Ron de Bruin Outlook object model (body)
http://www.rondebruin.nl/sendmail.htm This works very well thanks!Ron I would like to add a second sheet to the bottom of the emil (sheet1). How would you add a second sheet to the bottom of the body of the email? Thanks! Jeff |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
email multiple worksheets
Hi Jeff
Use it like this. This example add sheet1 and sheet2 in the body of the mail Sub Mail_Sheet_Outlook_Body() ' Don't forget to copy the function RangetoHTML in the module. ' Working in Office 2000-2007 Dim rng As Range Dim rng2 As Range Dim OutApp As Object Dim OutMail As Object With Application .EnableEvents = False .ScreenUpdating = False End With Set rng = Nothing Set rng2 = Nothing Set rng = Sheets("Sheet1").UsedRange Set rng2 = Sheets("Sheet2").UsedRange Set OutApp = CreateObject("Outlook.Application") OutApp.Session.Logon Set OutMail = OutApp.CreateItem(0) On Error Resume Next With OutMail .To = " .CC = "" .BCC = "" .Subject = "This is the Subject line" .HTMLBody = RangetoHTML(rng) & "<br<br" & RangetoHTML(rng2) .display 'or use .Send End With On Error GoTo 0 With Application .EnableEvents = True .ScreenUpdating = True End With Set OutMail = Nothing Set OutApp = Nothing End Sub -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Jeff" wrote in message ... I am using Ron de Bruin Outlook object model (body) http://www.rondebruin.nl/sendmail.htm This works very well thanks!Ron I would like to add a second sheet to the bottom of the emil (sheet1). How would you add a second sheet to the bottom of the body of the email? Thanks! Jeff |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
email multiple worksheets
That is what I was looking for. Thanks again Ron!
Jeff "Ron de Bruin" wrote: Hi Jeff Use it like this. This example add sheet1 and sheet2 in the body of the mail Sub Mail_Sheet_Outlook_Body() ' Don't forget to copy the function RangetoHTML in the module. ' Working in Office 2000-2007 Dim rng As Range Dim rng2 As Range Dim OutApp As Object Dim OutMail As Object With Application .EnableEvents = False .ScreenUpdating = False End With Set rng = Nothing Set rng2 = Nothing Set rng = Sheets("Sheet1").UsedRange Set rng2 = Sheets("Sheet2").UsedRange Set OutApp = CreateObject("Outlook.Application") OutApp.Session.Logon Set OutMail = OutApp.CreateItem(0) On Error Resume Next With OutMail .To = " .CC = "" .BCC = "" .Subject = "This is the Subject line" .HTMLBody = RangetoHTML(rng) & "<br<br" & RangetoHTML(rng2) .display 'or use .Send End With On Error GoTo 0 With Application .EnableEvents = True .ScreenUpdating = True End With Set OutMail = Nothing Set OutApp = Nothing End Sub -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Jeff" wrote in message ... I am using Ron de Bruin Outlook object model (body) http://www.rondebruin.nl/sendmail.htm This works very well thanks!Ron I would like to add a second sheet to the bottom of the emil (sheet1). How would you add a second sheet to the bottom of the body of the email? Thanks! Jeff |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
email multiple worksheets
You are welcome
-- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Jeff" wrote in message ... That is what I was looking for. Thanks again Ron! Jeff "Ron de Bruin" wrote: Hi Jeff Use it like this. This example add sheet1 and sheet2 in the body of the mail Sub Mail_Sheet_Outlook_Body() ' Don't forget to copy the function RangetoHTML in the module. ' Working in Office 2000-2007 Dim rng As Range Dim rng2 As Range Dim OutApp As Object Dim OutMail As Object With Application .EnableEvents = False .ScreenUpdating = False End With Set rng = Nothing Set rng2 = Nothing Set rng = Sheets("Sheet1").UsedRange Set rng2 = Sheets("Sheet2").UsedRange Set OutApp = CreateObject("Outlook.Application") OutApp.Session.Logon Set OutMail = OutApp.CreateItem(0) On Error Resume Next With OutMail .To = " .CC = "" .BCC = "" .Subject = "This is the Subject line" .HTMLBody = RangetoHTML(rng) & "<br<br" & RangetoHTML(rng2) .display 'or use .Send End With On Error GoTo 0 With Application .EnableEvents = True .ScreenUpdating = True End With Set OutMail = Nothing Set OutApp = Nothing End Sub -- Regards Ron de Bruin http://www.rondebruin.nl/tips.htm "Jeff" wrote in message ... I am using Ron de Bruin Outlook object model (body) http://www.rondebruin.nl/sendmail.htm This works very well thanks!Ron I would like to add a second sheet to the bottom of the emil (sheet1). How would you add a second sheet to the bottom of the body of the email? Thanks! Jeff |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Email Multiple Files to Multiple Email addresses | Excel Programming | |||
How do I count unique email addresses across multiple worksheets? | Excel Discussion (Misc queries) | |||
Email Worksheets---Please HELP | Excel Programming | |||
Macro to email multiple worksheets | Excel Worksheet Functions | |||
email as a group - multiple worksheets from one workbook | Excel Programming |