LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Excel and Outlook Email

Howdy,

I am creating an email from excel using the example from
www.dicks-clicks.com, but wanted to to add the following twist:

I want to define the To, CC, and subject from cells within
the workbook and I want to paste the excel range as
picture, versus sending an excel object.

I am encountering errors with the first part and not sure
how to approach the second part. Here is what I have so far:

Sub CreateEmail()

Dim olApp As Object
Dim olMail As Object

Dim stRecipient As String
Dim stCC As String
Dim stSubject As String


Set olApp = CreateObject("Outlook.Application")
Set olMail = olApp.CreateItem(0)

Set stRecipient = ActiveSheet.Range("To_List")
Set stCC = ActiveSheet.Range("CC_List")
Set stSubject = ActiveSheet.Range("Subject")

Set TestBody =
Worksheets("Rates").Range("Weekly_Rate_Range").Cop y

With olMail
.To = stRecipient
.cc = stCC
.Subject = stSubject
.Display
End With

Set olMail = Nothing
Set olApp = Nothing

End Sub

I get an "Object required" error at "Set stRecipient = ".
To_List, CC_List, and Subject are named cells on the active
sheet.

TIA

Regards
t
 
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
Excel and Email/Outlook Carl Excel Worksheet Functions 2 January 5th 07 11:56 AM
How do I get excel to create an email using Outlook? cleslie Excel Discussion (Misc queries) 0 November 30th 05 12:11 AM
Email from Excel WITHOUT Outlook Ron de Bruin Excel Programming 5 January 28th 04 07:49 PM
Email from Excel WITHOUT Outlook Cindy Excel Programming 0 January 28th 04 04:30 PM
Excel contents to Outlook email Mohan Manicks Excel Programming 2 December 13th 03 01:28 AM


All times are GMT +1. The time now is 01:58 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"