Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Send Range to Outlook and Email it

Hi, I have written code, which will search through a range pasted from
another sheet, select it. I want to store this range in an array and send it
in an outlook email based on the email address located in Column B. Here is
my code - LastCopiedRow is the currently selected row of data:


Range("A" & LastCopiedRow + 1) = "Department"
Range("B" & LastCopiedRow + 1) = "E-mail"
Range("C" & LastCopiedRow + 1) = "Last Name"
Range("D" & LastCopiedRow + 1) = "First Name"
Range("E" & LastCopiedRow + 1) = "Start Date"
Range("F" & LastCopiedRow + 1) = "Position Title"
Range("G" & LastCopiedRow + 1) = "Initial Review Date"
Range("H" & LastCopiedRow + 1) = "Satisfactory?"
Range("J" & LastCopiedRow + 1) = "Current Review Date"
Range("A" & LastCopiedRow + 1 & ":J" & LastCopiedRow + K + 1).Select

Dim EmailArray() As Variant
EmailArray = Range("A" & LastCopiedRow + 1 & ":J" & LastCopiedRow + K + 1)

SendEmail (EmailArray)



Sub SendEmail(ByRef EmailArray As Variant)

ThisSelection = Selection
'Sets Outlook variables
Dim olApp As Outlook.Application
Dim olMail As MailItem
Set olApp = New Outlook.Application
Set olMail = olApp.CreateItem(olMailItem)


With olMail
'Send email to address in column A
.To = "
'ActiveSheet.Range("B2").Text
'.from = "
.Subject = "Employee Reviews Due"
'Include employee information in email
.Body = EmailArray
.Display
.Send
End With

'Reset variables to nothing
Set olMail = Nothing
Set olApp = Nothing
--
Markb
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
Send a Sheet as body of Outlook Email David Ackerman on cape cod Excel Discussion (Misc queries) 0 March 19th 10 03:11 PM
Outlook Email Send Dialog Boxes, Excel 2003 How to Turn Off or Rem Kit Excel Discussion (Misc queries) 0 May 11th 07 06:33 PM
How to send a single page email from excel 2000 using outlook xp vols2812 Excel Worksheet Functions 1 December 30th 06 06:45 PM
***** PLEASE HELP **** Send an email from Excel to outlook with an automatic macro SAM SEBAIHI Excel Discussion (Misc queries) 0 November 11th 06 08:17 AM
How do use outlook express to send email in office 2003 How do use outlook express to send email Excel Discussion (Misc queries) 1 July 19th 05 12:35 PM


All times are GMT +1. The time now is 07:09 AM.

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"