LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 26
Default SendKeys problem

I have the following code, based on that at Ron de Bruin's site, which
creates emails exactly as required, except that the SendKeys line does
nothing. I've tried some variations of syntax, and it doesn't give an
errormessage, but it just doesn't send. Does anyone have a suggestion as
to what I'm doing wrong, or an alternative way of getting Outlook
Express to send?

Sub SendEmail()
DatabaseOpen
Set template = Workbooks("sendEmail.xls").Sheets("Sheet1")
For Each Cell In
Workbooks("ycDatabase.xls").Sheets("Database").Col umns("M").Cells.Specia
lCells(xlCellTypeConstants)
If Cell.Value Like "*@*" Then
Recipient = Cell.Value
Subj = template.Range("c3").Value
msg = "Dear " & Cell.Offset(0, -10).Value & "%0A"
msg = msg & "%0A" & template.Range("c5").Value
HLink = "mailto:" & Recipient & "?"
HLink = HLink & "subject=" & Subj & "&"
HLink = HLink & "body=" & msg
ActiveWorkbook.FollowHyperlink (HLink)
Application.Wait (Now + TimeValue("0:00:02"))
Application.SendKeys "%S", True
End If
Next
End Sub

--
Gordon Rainsford

London UK
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
SendKeys syntax problem VBAvirgin New Users to Excel 2 January 4th 06 04:42 PM
SendKeys problem Zakynthos Excel Programming 2 September 26th 05 07:18 PM
sendkeys problem jmoffat[_17_] Excel Programming 1 June 17th 05 05:30 PM
sendkeys problem for telnet mike Excel Programming 1 June 15th 05 02:12 PM
SendKeys problem Rod Armour Excel Programming 3 January 23rd 04 10:44 PM


All times are GMT +1. The time now is 11:59 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"