![]() |
Email Range Contents
I would appreciate knowing how to email the contents of a named range as
email text, so the recipients see the text directly right when they open the email message, i.e., NOT an attachment. VBA's SendMail and Route methods send the entire workbook object, but I don't want to send the workbook. Can this be done? Roy |
Email Range Contents
Roy, have a look here
http://www.rondebruin.nl/sendmail.htm#Tips -- Paul B Always backup your data before trying something new Please post any response to the newsgroups so others can benefit from it Feedback on answers is always appreciated! Using Excel 2002 & 2003 "Roy Harrill" wrote in message ... I would appreciate knowing how to email the contents of a named range as email text, so the recipients see the text directly right when they open the email message, i.e., NOT an attachment. VBA's SendMail and Route methods send the entire workbook object, but I don't want to send the workbook. Can this be done? Roy |
Email Range Contents
Roy,
This may help. Try brfore you use. This came from one of the MVP's site, but cannot remember which.Note you must enter a E-Maill address where indicated. HTH Sub sendMymail() Application.ScreenUpdating = False Dim oConf As Object Set oMsg = CreateObject("CDO.Message") Set oConf = CreateObject("CDO.Configuration") oConf.Load -1 ' CDO Source Defaults Set Flds = oConf.Fields With Flds .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "your e-mail address" .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 .Update End With With oMsg Set .Configuration = oConf .To = "your e-mail address" .Subject = "Your message" .TextBody = Sheet1.Range("a1") .Send End With Set oMsg = Nothing Set oConf = Nothing End Sub "Roy Harrill" wrote in message ... I would appreciate knowing how to email the contents of a named range as email text, so the recipients see the text directly right when they open the email message, i.e., NOT an attachment. VBA's SendMail and Route methods send the entire workbook object, but I don't want to send the workbook. Can this be done? Roy |
Email Range Contents
For more info about CDO see
http://www.rondebruin.nl/cdo.htm -- Regards Ron de Bruin http://www.rondebruin.nl "Charles Harmon" wrote in message ... Roy, This may help. Try brfore you use. This came from one of the MVP's site, but cannot remember which.Note you must enter a E-Maill address where indicated. HTH Sub sendMymail() Application.ScreenUpdating = False Dim oConf As Object Set oMsg = CreateObject("CDO.Message") Set oConf = CreateObject("CDO.Configuration") oConf.Load -1 ' CDO Source Defaults Set Flds = oConf.Fields With Flds .Item("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 .Item("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "your e-mail address" .Item("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 .Update End With With oMsg Set .Configuration = oConf .To = "your e-mail address" .Subject = "Your message" .TextBody = Sheet1.Range("a1") .Send End With Set oMsg = Nothing Set oConf = Nothing End Sub "Roy Harrill" wrote in message ... I would appreciate knowing how to email the contents of a named range as email text, so the recipients see the text directly right when they open the email message, i.e., NOT an attachment. VBA's SendMail and Route methods send the entire workbook object, but I don't want to send the workbook. Can this be done? Roy |
All times are GMT +1. The time now is 01:13 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com