#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default email

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




  #2   Report Post  
Posted to microsoft.public.excel.programming
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






Reply
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
Using Macro how to create email link for the email addresses in aRange or Selection Satish[_2_] Excel Worksheet Functions 8 December 28th 09 03:30 PM
send wkbk as an email attachment with an email address copied from SueInAtl Excel Discussion (Misc queries) 0 May 21st 07 10:53 PM
can I copy a column of email addresses, paste into email address? Lizizfree New Users to Excel 4 July 20th 06 10:03 PM
Transfer Email addresses from spreadsheet to email address book Beana Excel Discussion (Misc queries) 2 May 30th 06 06:07 PM
Email editor closes when forwarding Excel-embedded email Bambina Setting up and Configuration of Excel 0 March 16th 06 10:45 PM


All times are GMT +1. The time now is 05:04 AM.

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

About Us

"It's about Microsoft Excel"