Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 921
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 921
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Email Multiple Files to Multiple Email addresses LoriH Excel Programming 3 March 2nd 09 08:08 PM
How do I count unique email addresses across multiple worksheets? Kenny Brooks Excel Discussion (Misc queries) 2 July 30th 08 08:38 PM
Email Worksheets---Please HELP Mir Khan Excel Programming 2 July 23rd 07 08:50 PM
Macro to email multiple worksheets Daniel Excel Worksheet Functions 1 May 27th 05 04:19 AM
email as a group - multiple worksheets from one workbook Penny Excel Programming 5 September 13th 04 05:23 PM


All times are GMT +1. The time now is 01:39 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"