PDA

View Full Version : Solved: Email ONLY current page



Kippers
11-26-2006, 10:23 PM
I have a macro that creates an outlook session and creates an email with a distribution list I only want to send the summary sheet of the workbook not the whole workbook

How do i copy one sheet into the body of an email?

ilyaskazi
11-26-2006, 11:00 PM
If you only wish to send one Worksheet from a Workbook you can use the method shown below. It creates a new Workbook housing ONLY the sheet that copy. It then sends the 1 sheet Workbook as an attachment, then closes the new Workbook without saving.


Sub Send1Sheet_ActiveWorkbook()
'Create a new Workbook Containing 1 Sheet _
and sends as attachment.
With ActiveWorkbook
.Sheets(1).Copy
.SendMail Recipients:="dump@vbaexpress.com", _
Subject:="Try Me " & Format(Date, "dd/mmm/yy")
.Close SaveChanges:=False
End With
End Sub
HTH
ilyaskazi :*)

Bob Phillips
11-27-2006, 01:57 AM
See http://www.rondebruin.nl/mail/folder1/mail2.htm

johnske
11-27-2006, 03:01 AM
or see http://xlvba.3.forumer.com/index.php?showtopic=223

Kippers
11-27-2006, 01:26 PM
Had already thought of that as a fall back option.
I can copy the page to the clipboard using:

Range("a1:d11").CopyPicture xlScreen, xlBitmap

I just dont know how to them copy it down from the clipboard to the body of the email

johnske
11-27-2006, 01:34 PM
Manually... click File > Send To, leave the option "Send the current sheet as the message body" checked, then click OK...

Kippers
11-27-2006, 01:45 PM
Anybody know the vba code to do this - when i record i get nothing

johnske
11-27-2006, 01:56 PM
To do what? If you're referring to my last post, follow the link in my first post.

If you're referring to copying from the clipboard to the body of the email - there's no need, Excel has the built-in functionality to do this without a copy-paste

Kippers
11-28-2006, 01:24 PM
Sorry - missing something here
I can do the send the current sheet as the body of an email manually by following the menu path as click File > Send To, leave the option "Send the current sheet as the message body"
But i need to do this as vba code

johnske
11-28-2006, 02:49 PM
Sorry - missing something here
I can do the send the current sheet as the body of an email manually by following the menu path as click File > Send To, leave the option "Send the current sheet as the message body"
But i need to do this as vba code????? Can't you read? I'll assume you don't know how to scroll back up the page....

Click >> HERE (http://xlvba.3.forumer.com/index.php?showtopic=223) << to get your code