Send selection in body of email

D

David

Using XL2K and Outlook Express, is there a way to send the contents of a 2-
cell range (A2:A3) from a file in the *body* of an email msg to a specified
recipient?

Something like:

Range("A2:A3").SendMail "[email protected]", "This weeks average attendance"
 
D

David

Norman Harker wrote
See:

Ron de Bruin:
http://www.rondebruin.nl/sendmail.htm#selection

But you might prefer to download Ron's SendMail Addin from:

http://www.rondebruin.nl/sendmail-addin.htm

Hi, Norman

I did have a look at Ron's site for clues, but methods all appear to create
a separate .xls file attached to the email, including the AddIn. I wanted
something that included a couple of cells' values in the *body* of the msg.
Fumbling around with other posts on the subject, I ended up with this:

Sub Mail_It()
Dim Msg As String
Dim Recipient As String, Subj As String, HLink As String
Recipient = "[email protected]"
Subj = "This Week's Average Attendance"
Msg = Range("A2") & "%0A" & Range("A3")
HLink = "mailto:" & Recipient & "?"
HLink = HLink & "subject=" & Subj & "&"
HLink = HLink & "body=" & Msg
ActiveWorkbook.FollowHyperlink (HLink)
Application.Wait (Now + TimeValue("0:00:04"))
Application.SendKeys "%s", True
End Sub

Thanks for jumping in, though.
 
D

David

Ron de Bruin wrote
I now read the whole thread and see you use OE

Then this is the only way
http://www.rondebruin.nl/sendmail.htm#body

I had a second (or third or fourth) look and I believe my posted code
pretty much uses the same method(s)as the OE example there, with a few
shortcuts I spotted elsewhere that satisfied my minimal needs. I got
overwhelmed at first glance with all the scenarios you present on your site
(awe, not criticism), so I apologize for not recognizing what I needed
right off. I probably could have saved myself considerable time if I had.
 
Top