Script to send

J

jenelle

The following code is from a KB article. It works as is, except cell block
displays black(with white lines) in the Outlook email. How do I make the data
visible? Also, how to set Range = cells that the user has highlighted rather
than A1:C10?

Sub Send_Range()

' Select the range of cells on the active worksheet.
'ActiveSheet.Range ("A1:C10").Select

' Show the envelope on the ActiveWorkbook.
ActiveWorkbook.EnvelopeVisible = True

' Set the optional introduction field thats adds header text to the email
body. It also sets
' the To and Subject lines. Finally the message is sent.
With ActiveSheet.MailEnvelope
.Introduction = "This is a sample of data from my worksheet."
.Item.To = "jenellea"
.Item.Subject = "Selection from Excel Workbook"
.Item.Send
End With
End Sub
 
J

Jim Rech

The range emailed is whatever the current selection is, so just remove any
code that selects a range. I don't know what your problem is with the
message display. I just get a standard text mail message of black text on a
white background in Outlook.

--
Jim Rech
Excel MVP
| The following code is from a KB article. It works as is, except cell block
| displays black(with white lines) in the Outlook email. How do I make the
data
| visible? Also, how to set Range = cells that the user has highlighted
rather
| than A1:C10?
|
| Sub Send_Range()
|
| ' Select the range of cells on the active worksheet.
| 'ActiveSheet.Range ("A1:C10").Select
|
| ' Show the envelope on the ActiveWorkbook.
| ActiveWorkbook.EnvelopeVisible = True
|
| ' Set the optional introduction field thats adds header text to the
email
| body. It also sets
| ' the To and Subject lines. Finally the message is sent.
| With ActiveSheet.MailEnvelope
| .Introduction = "This is a sample of data from my worksheet."
| .Item.To = "jenellea"
| .Item.Subject = "Selection from Excel Workbook"
| .Item.Send
| End With
| End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top