jackdandcoke
10-09-2008, 12:23 PM
I've been e-mailing an attachment from excel using the code:
Dim OL As Object
Dim EmailItem As Object
Dim Wb As Workbook
Application.ScreenUpdating = False
Set OL = CreateObject("Outlook.Application")
Set EmailItem = OL.CreateItem(olMailItem)
Set Wb = ActiveWorkbook
Wb.Save
With EmailItem
.Importance = olImportanceHigh
.Subject = "Central Webathon Reporting Oct 3-5"
.Body = "Julia, Attached is the webathon report for the weekend of Oct. 3rd. If there are any issues please contact me at me@mycompany.com or call my cell at xxx-xxx-xxxx"
.To = "whoever@whatever.com"
.CC = "me@mycompany.com"
.Attachments.Add Wb.FullName
.Send
End With
Application.ScreenUpdating = True
Set Wb = Nothing
Set OL = Nothing
Set EmailItem = Nothing
Is there a way using this code to paste three ranges of cells into the .Body instead of just one sentence?
I'd like it to look like:
"Top Performer:"
cells A2:B2
"Hourly Rankings:"
cells A4:B13
"Cumulative Rankings:"
cells A15:B24
My boss pretty much 'Lumberged' me into this....yeah...we're going to need you to work Saturday....:banghead:
Dim OL As Object
Dim EmailItem As Object
Dim Wb As Workbook
Application.ScreenUpdating = False
Set OL = CreateObject("Outlook.Application")
Set EmailItem = OL.CreateItem(olMailItem)
Set Wb = ActiveWorkbook
Wb.Save
With EmailItem
.Importance = olImportanceHigh
.Subject = "Central Webathon Reporting Oct 3-5"
.Body = "Julia, Attached is the webathon report for the weekend of Oct. 3rd. If there are any issues please contact me at me@mycompany.com or call my cell at xxx-xxx-xxxx"
.To = "whoever@whatever.com"
.CC = "me@mycompany.com"
.Attachments.Add Wb.FullName
.Send
End With
Application.ScreenUpdating = True
Set Wb = Nothing
Set OL = Nothing
Set EmailItem = Nothing
Is there a way using this code to paste three ranges of cells into the .Body instead of just one sentence?
I'd like it to look like:
"Top Performer:"
cells A2:B2
"Hourly Rankings:"
cells A4:B13
"Cumulative Rankings:"
cells A15:B24
My boss pretty much 'Lumberged' me into this....yeah...we're going to need you to work Saturday....:banghead: