ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Script to send (https://www.excelbanter.com/excel-programming/320247-script-send.html)

jenelle

Script to send
 
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

Jim Rech

Script to send
 
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
"jenelle" wrote in message
...
| 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




All times are GMT +1. The time now is 05:15 PM.

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