ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Excel Copy and Paste into Outlook e-mail (https://www.excelbanter.com/excel-programming/318333-excel-copy-paste-into-outlook-e-mail.html)

Compuser

Excel Copy and Paste into Outlook e-mail
 
This is what I'd like to do with VBA: COPY a range of cells in Excel
and PASTE it into a new Outlook e-mail message. I know you can display
an Excel worksheet or range in Outlook, but for my purposes, I'd like
to COPY and PASTE.

I found this on the web. Can someone please help adding to this? The
mailitem
object doesn't seem to support .paste.

Sub Test
Dim objApp As Outlook.Application
Dim Msg As MailItem
Set objApp = CreateObject("Outlook.Application")
Set Msg = objApp.CreateItem(olMailItem)

Sheets("Sheet1").Select
Selection.Copy

<<<<<What Do I put in here???

Msg.Recipients.Add ")
Msg.Send
End Sub


I have both 2002 and 2003 versions of Excel & Outlook.

Thanks in advance!

Sharad Naik

Excel Copy and Paste into Outlook e-mail
 
It is not possible to copy / paste an entire sheet there.

The MailItem refers to complete mail item and not to the Body of the mail
item.

You can use Msg.Body = " ......................."
But it has to be a string . you can not set Msg.Body to a Worksheet.

Sharad

"Compuser" wrote in message
om...
This is what I'd like to do with VBA: COPY a range of cells in Excel
and PASTE it into a new Outlook e-mail message. I know you can display
an Excel worksheet or range in Outlook, but for my purposes, I'd like
to COPY and PASTE.

I found this on the web. Can someone please help adding to this? The
mailitem
object doesn't seem to support .paste.

Sub Test
Dim objApp As Outlook.Application
Dim Msg As MailItem
Set objApp = CreateObject("Outlook.Application")
Set Msg = objApp.CreateItem(olMailItem)

Sheets("Sheet1").Select
Selection.Copy

<<<<<What Do I put in here???

Msg.Recipients.Add ")
Msg.Send
End Sub


I have both 2002 and 2003 versions of Excel & Outlook.

Thanks in advance!




Ron de Bruin

Excel Copy and Paste into Outlook e-mail
 
See
http://www.rondebruin.nl/sendmail.htm


--
Regards Ron de Bruin
http://www.rondebruin.nl


"Compuser" wrote in message om...
This is what I'd like to do with VBA: COPY a range of cells in Excel
and PASTE it into a new Outlook e-mail message. I know you can display
an Excel worksheet or range in Outlook, but for my purposes, I'd like
to COPY and PASTE.

I found this on the web. Can someone please help adding to this? The
mailitem
object doesn't seem to support .paste.

Sub Test
Dim objApp As Outlook.Application
Dim Msg As MailItem
Set objApp = CreateObject("Outlook.Application")
Set Msg = objApp.CreateItem(olMailItem)

Sheets("Sheet1").Select
Selection.Copy

<<<<<What Do I put in here???

Msg.Recipients.Add ")
Msg.Send
End Sub


I have both 2002 and 2003 versions of Excel & Outlook.

Thanks in advance!





All times are GMT +1. The time now is 03:40 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com