Thread: email
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ron de Bruin Ron de Bruin is offline
external usenet poster
 
Posts: 11,123
Default email

Hi Beeel

look at this webpage for examples
http://www.rondebruin.nl/sendmail.htm

--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2000-2003)
www.rondebruin.nl



"Beeel" wrote in message ...
Sorry I posted this in the wrong group earlier
Someone from the group kindly gave me the following code for sending a range
as an e-mail
""Public Sub SendEMailByURL()
Dim vURL As String
Dim vEmail As String
Dim vSubj As String
Dim vMsg As String
Dim vTitleEmail As String
Dim i As Long
Dim vShell
'Copy range selection to paste
Range("a8:p18").Copy
'Email data
vEmail = "
vSubj = "Raukawa"
vMsg = " "
vTitleEmail = vSubj
'Spaces to hexdecimal
vSubj = Application.WorksheetFunction.Substitute(vSubj, " ", "%20")
vMsg = Application.WorksheetFunction.Substitute(vMsg, " ", "%20")
'Carriage Returns to hexdecimal
vMsg = Application.WorksheetFunction.Substitute(vMsg, vbCrLf,
"%0D%0A")
vURL = "mailto:" & vEmail & "?subject=" & vSubj & "&body=" & vMsg
'Shell the Windows Start
vShell = Shell(Left("Start " & vURL, 460), vbHide)
'Wait window email before sending keystrokes
WaitEmail:
On Error Resume Next
i = i + 1
Application.Wait (Now + TimeValue("0:00:01"))
AppActivate vTitleEmail 'Verify your title email
If Err.Number < 0 And i < 30 Then GoTo WaitEmail
Application.SendKeys "{TAB}{TAB}{TAB}{TAB}~^v"
Application.Wait (Now + TimeValue("0:00:01"))
End Sub""
It works perfectly from home where I use Outlook express
I can't get it to function from work where I use Outlook
It stops at the line: "vShell = Shell(Left("Start " & vURL, 460), vbHide)"
I'm not savvy enough to work it out for myself
Can someone please help?

Barry