Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Copy/Paste to email

I use the code below (which someone out there kindly sent to me) to put a
range into an email message.
The problem is that I have to "paste" into the body of the email.
Can someone supply code that does this automatically,
"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"

Barry


  #2   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Copy/Paste to email

hi,
see this web site.
http://www.rondebruin.nl/sendmail.htm
ron knows a thing or 2 about emailing from xl.
good luck.

-----Original Message-----
I use the code below (which someone out there kindly sent

to me) to put a
range into an email message.
The problem is that I have to "paste" into the body of

the email.
Can someone supply code that does this automatically,
"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"

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
Conditional formatting - copy & paste to an email Gapps Excel Discussion (Misc queries) 0 July 17th 07 05:56 AM
can I copy a column of email addresses, paste into email address? Lizizfree New Users to Excel 4 July 20th 06 10:03 PM
Need a macro to Copy a selection and paste into a new email. Koolmist Excel Discussion (Misc queries) 3 February 20th 06 04:48 PM
Copy and Paste from Excel into Outlook Email message TroyB[_2_] Excel Programming 0 November 10th 04 08:01 AM
Copy and Paste a Worksheet Range to Email Body Eric[_14_] Excel Programming 1 January 20th 04 12:06 AM


All times are GMT +1. The time now is 01:28 PM.

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"