PC Review


Reply
Thread Tools Rate Thread

Copying Excel Data Into Outlook via macro

 
 
MASharp@gmail.com
Guest
Posts: n/a
 
      2nd May 2008
So I had a form in Excel 03, and my hope is to push a macro button and
have the form be copied into the body of an Outlook 03 email.
Current, using the code below I'm able to copy one cell into the body
(in the case below, "A2"). When I change it from olMail.Body =
Range("A2") to olMail.Body = Range("A2:C14"), which is the true range
I want copied over, I get an "Array lower bound musy be zero" error.
Any ideas? Thx

================================
Sub email()

Dim olApp As Object, olMail As Object

Set olApp = CreateObject("Outlook.Application")
Set olMail = olApp.CreateItem(0)
olMail.To = "(E-Mail Removed)"
olMail.Subject = Range("B4")
olMail.Body = Range("A2")

olMail.Display

'Reactive Excel
AppActivate "Microsoft Excel"

End Sub
===================================
 
Reply With Quote
 
 
 
 
ryguy7272
Guest
Posts: n/a
 
      2nd May 2008
This shoudl get you to where you want to be:
http://www.rondebruin.nl/sendmail.htm
Outlook object model (body)


Regards,
Ryan---
--
RyGuy


"(E-Mail Removed)" wrote:

> So I had a form in Excel 03, and my hope is to push a macro button and
> have the form be copied into the body of an Outlook 03 email.
> Current, using the code below I'm able to copy one cell into the body
> (in the case below, "A2"). When I change it from olMail.Body =
> Range("A2") to olMail.Body = Range("A2:C14"), which is the true range
> I want copied over, I get an "Array lower bound musy be zero" error.
> Any ideas? Thx
>
> ================================
> Sub email()
>
> Dim olApp As Object, olMail As Object
>
> Set olApp = CreateObject("Outlook.Application")
> Set olMail = olApp.CreateItem(0)
> olMail.To = "(E-Mail Removed)"
> olMail.Subject = Range("B4")
> olMail.Body = Range("A2")
>
> olMail.Display
>
> 'Reactive Excel
> AppActivate "Microsoft Excel"
>
> End Sub
> ===================================
>

 
Reply With Quote
 
MASharp@gmail.com
Guest
Posts: n/a
 
      2nd May 2008
Worked like a charm. Thanks!
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
accessing outlook data using excel macro =?Utf-8?B?amF1bmRpY2U=?= Microsoft Excel Charting 0 27th Jun 2007 11:30 PM
Copying Data from Access to Excel in a macro =?Utf-8?B?R0xT?= Microsoft Excel Worksheet Functions 2 15th Nov 2006 03:47 PM
Copying Data from Excel to MS Outlook in Plain Text Mode JohnGuts Microsoft Excel Worksheet Functions 0 30th Jul 2006 09:57 PM
Macro copying info/data in multiple excel files into one summary file. Jskasango Microsoft Excel Programming 10 6th Apr 2006 08:27 AM
Macro for copying data Roger Bell Microsoft Access 7 20th Nov 2004 04:26 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:21 AM.