Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i have looked at code on the sites listed, no luck. always returns an error,
method "sendmail" of object '_workbook failed. tried code to send a text message, that worked, but can't figure out how to get a copied range into the body. i tried sendkeys, to tab 4 times, cursor actually got to the body once, but usually it stays in the to header. sometimes, i have managed to paste the selection into the to header, instead of the body. -- Gary |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Give this a go.
http://www.paulsadowski.com/WSH/cdo.htm -- Regards, Dave Patrick ....Please no email replies - reply in newsgroup. Microsoft Certified Professional Microsoft MVP [Windows] http://www.microsoft.com/protect "Gary Keramidas" wrote: |i have looked at code on the sites listed, no luck. always returns an error, | method "sendmail" of object '_workbook failed. tried code to send a text | message, that worked, but can't figure out how to get a copied range into | the body. i tried sendkeys, to tab 4 times, cursor actually got to the body | once, but usually it stays in the to header. sometimes, i have managed to | paste the selection into the to header, instead of the body. | | | | | -- | | | Gary | | | |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
thanks dave, but isn't there any way to just past the range i've copied to
the clipboard in the body of an outlook express email? -- Gary "Dave Patrick" wrote in message ... Give this a go. http://www.paulsadowski.com/WSH/cdo.htm -- Regards, Dave Patrick ....Please no email replies - reply in newsgroup. Microsoft Certified Professional Microsoft MVP [Windows] http://www.microsoft.com/protect "Gary Keramidas" wrote: |i have looked at code on the sites listed, no luck. always returns an error, | method "sendmail" of object '_workbook failed. tried code to send a text | message, that worked, but can't figure out how to get a copied range into | the body. i tried sendkeys, to tab 4 times, cursor actually got to the body | once, but usually it stays in the to header. sometimes, i have managed to | paste the selection into the to header, instead of the body. | | | | | -- | | | Gary | | | |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Afraid there's no object model within OE and IMO SendKeys is too flakey
(some process may unexpectedly steal the focus in the middle). You should be able to instantiate the CDO.Message object in your code to send the mail message using one of Paul's examples. -- Regards, Dave Patrick ....Please no email replies - reply in newsgroup. Microsoft Certified Professional Microsoft MVP [Windows] http://www.microsoft.com/protect "Gary Keramidas" wrote: | thanks dave, but isn't there any way to just past the range i've copied to | the clipboard in the body of an outlook express email? | | -- | | | Gary |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
ok, thanks dave, i figured i had adapted this code i found to open and
address a new email and just needed a way to paste the clipboard info Sub Mail() 'Example for Outlook Express Dim msg As String Dim cell As Range Dim Recipient As String Dim Subj As String Dim HLink As String Recipient = "my email" Subj = "email" Sheets("payroll report").Range("b4:q34").Copy HLink = "mailto:" & Recipient & "?" HLink = HLink & "subject=" & Subj ActiveWorkbook.FollowHyperlink (HLink) Application.Wait (Now + TimeValue("0:00:03")) Application.SendKeys "%s" End Sub -- Gary "Dave Patrick" wrote in message ... Afraid there's no object model within OE and IMO SendKeys is too flakey (some process may unexpectedly steal the focus in the middle). You should be able to instantiate the CDO.Message object in your code to send the message using one of Paul's examples. -- Regards, Dave Patrick ....Please no email replies - reply in newsgroup. Microsoft Certified Professional Microsoft MVP [Windows] http://www.microsoft.com/protect "Gary Keramidas" wrote: | thanks dave, but isn't there any way to just past the range i've copied to | the clipboard in the body of an outlook express email? | | -- | | | Gary |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
i think i'll just tell the client to click file/send to. it's a lot easier
-- Gary "Dave Patrick" wrote in message ... Afraid there's no object model within OE and IMO SendKeys is too flakey (some process may unexpectedly steal the focus in the middle). You should be able to instantiate the CDO.Message object in your code to send the message using one of Paul's examples. -- Regards, Dave Patrick ....Please no email replies - reply in newsgroup. Microsoft Certified Professional Microsoft MVP [Windows] http://www.microsoft.com/protect "Gary Keramidas" wrote: | thanks dave, but isn't there any way to just past the range i've copied to | the clipboard in the body of an outlook express email? | | -- | | | Gary |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
one other question:
how come code posted on a lot of these websites never runs as posted? there are always variables or something missing. half the time, that's the hardest part for me to set up. -- Gary "Dave Patrick" wrote in message ... Afraid there's no object model within OE and IMO SendKeys is too flakey (some process may unexpectedly steal the focus in the middle). You should be able to instantiate the CDO.Message object in your code to send the message using one of Paul's examples. -- Regards, Dave Patrick ....Please no email replies - reply in newsgroup. Microsoft Certified Professional Microsoft MVP [Windows] http://www.microsoft.com/protect "Gary Keramidas" wrote: | thanks dave, but isn't there any way to just past the range i've copied to | the clipboard in the body of an outlook express email? | | -- | | | Gary |
#8
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try another site, Gary:
www.vbaexpress.com ******************* ~Anne Troy www.OfficeArticles.com www.MyExpertsOnline.com "Gary Keramidas" wrote in message ... one other question: how come code posted on a lot of these websites never runs as posted? there are always variables or something missing. half the time, that's the hardest part for me to set up. -- Gary "Dave Patrick" wrote in message ... Afraid there's no object model within OE and IMO SendKeys is too flakey (some process may unexpectedly steal the focus in the middle). You should be able to instantiate the CDO.Message object in your code to send the message using one of Paul's examples. -- Regards, Dave Patrick ....Please no email replies - reply in newsgroup. Microsoft Certified Professional Microsoft MVP [Windows] http://www.microsoft.com/protect "Gary Keramidas" wrote: | thanks dave, but isn't there any way to just past the range i've copied to | the clipboard in the body of an outlook express email? | | -- | | | Gary |
#9
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Give this a try;
Public Sub SendMail() Dim objMessage Set objMessage = CreateObject("CDO.Message") objMessage.Subject = "Example CDO Message" objMessage.Sender = " objMessage.To = " objMessage.TextBody = GetData '==This section provides the configuration information for the remote SMTP server. '==Normally you will only change the server name or IP. objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 'Name or IP of SMTP Server objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = "mail.keramidas.com" 'Server port (typically 25) objMessage.Configuration.Fields.Item _ ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = 25 objMessage.Configuration.Fields.Update '==End remote SMTP server configuration section== objMessage.Send Set objMessage = Nothing End Sub Function GetData() Dim strTemp As String 'This is the column of our first cell. x = 2 Do While Sheets("sheet1").Cells(4, x).Value < "" strTemp = strTemp & Trim(Sheets("sheet1").Cells(4, x).Value) & Space(1) x = x + 1 Loop GetData = strTemp End Function -- Regards, Dave Patrick ....Please no email replies - reply in newsgroup. Microsoft Certified Professional Microsoft MVP [Windows] http://www.microsoft.com/protect "Gary Keramidas" wrote: | one other question: | | how come code posted on a lot of these websites never runs as posted? there | are always variables or something missing. half the time, that's the hardest | part for me to set up. | | -- | | | Gary |
#10
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
For OE see
http://www.rondebruin.nl/mail/oebody.htm -- Regards Ron de Bruin http://www.rondebruin.nl "Gary Keramidas" wrote in message ... i have looked at code on the sites listed, no luck. always returns an error, method "sendmail" of object '_workbook failed. tried code to send a text message, that worked, but can't figure out how to get a copied range into the body. i tried sendkeys, to tab 4 times, cursor actually got to the body once, but usually it stays in the to header. sometimes, i have managed to paste the selection into the to header, instead of the body. -- Gary |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Outlook Express | Excel Discussion (Misc queries) | |||
Outlook Express | Excel Discussion (Misc queries) | |||
Send to Outlook 2000 not Outlook Express | Excel Discussion (Misc queries) | |||
Send a range in Excel as the body of an Outlook Express message | Excel Programming | |||
Display mail application either in Outlook, or Outlook express | Excel Programming |