Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Send a range in Excel as the body of an Outlook Express message

Is Outlook Express can send a range in Excel as the body like Outlook?

I would like to write a marco to send a range in Excel with Outlook Express use Copy and Paste.

I have find some code from the Internet as the following:

Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Sub SendEMail()
Dim Email As String, Subj As String
Dim Msg As String, URL As String
Dim r As Integer, x As Double
Dim katie As Variant

Email =

' Message subject
Subj = "Price List"

' Compose the message
Worksheets("Sheet1").Activate
ActiveSheet.UsedRange.Copy

Application.SendKeys "{Tab}{Tab}{Tab}{Tab}{Tab}^{End}{Return}{Return}^v " <== "I would like to paste the range in the body but don't know how to do that."


Msg = <==



' Replace spaces with %20 (hex)
Subj = Application.WorksheetFunction.Substitute(Subj, " ", "%20")
Msg = Application.WorksheetFunction.Substitute(Msg, " ", "%20")

' Replace carriage returns with %0D%0A (hex)
Msg = Application.WorksheetFunction.Substitute(Msg, vbCrLf, "%0D%0A")
' Create the URL
URL = "mailto:" & Email & "?subject=" & Subj & "&body=" & Msg

' Execute the URL (start the email client)
ShellExecute 0&, vbNullString, URL, vbNullString, vbNullString, vbNormalFocus





End Sub

Is there any way to paste the range as the body of the message other then sendkey?

Thanks.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Send a range in Excel as the body of an Outlook Express message

Hi Katie,

See :

http://www.rondebruin.nl/sendmail.htm


While there, look at Ron de Bruin's SendMail addins.


---
Regards,
Norman



"Katie" wrote in message
...
Is Outlook Express can send a range in Excel as the body like Outlook?

I would like to write a marco to send a range in Excel with Outlook Express
use Copy and Paste.

I have find some code from the Internet as the following:

Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As
String, _
ByVal nShowCmd As Long) As Long
Sub SendEMail()
Dim Email As String, Subj As String
Dim Msg As String, URL As String
Dim r As Integer, x As Double
Dim katie As Variant

Email =

' Message subject
Subj = "Price List"

' Compose the message
Worksheets("Sheet1").Activate
ActiveSheet.UsedRange.Copy

Application.SendKeys
"{Tab}{Tab}{Tab}{Tab}{Tab}^{End}{Return}{Return}^v " <== "I would like to
paste the range in the body but don't know how to do that."


Msg = <==



' Replace spaces with %20 (hex)
Subj = Application.WorksheetFunction.Substitute(Subj, " ", "%20")
Msg = Application.WorksheetFunction.Substitute(Msg, " ", "%20")

' Replace carriage returns with %0D%0A (hex)
Msg = Application.WorksheetFunction.Substitute(Msg, vbCrLf,
"%0D%0A")
' Create the URL
URL = "mailto:" & Email & "?subject=" & Subj & "&body=" & Msg

' Execute the URL (start the email client)
ShellExecute 0&, vbNullString, URL, vbNullString, vbNullString,
vbNormalFocus





End Sub

Is there any way to paste the range as the body of the message other then
sendkey?

Thanks.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Send a range in Excel as the body of an Outlook Express message

Hi Katie

Is there any way to paste the range as the body of the message other then sendkey?

Not really with OE

For a small range you can use this
http://www.rondebruin.nl/mail/oebody.htm

But if you are using Win 2000 or windows XP look at this page
http://www.rondebruin.nl/cdo.htm



--
Regards Ron de Bruin
http://www.rondebruin.nl


"Katie" wrote in message ...
Is Outlook Express can send a range in Excel as the body like Outlook?

I would like to write a marco to send a range in Excel with Outlook Express use Copy and Paste.

I have find some code from the Internet as the following:

Private Declare Function ShellExecute Lib "shell32.dll" _
Alias "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _
ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, _
ByVal nShowCmd As Long) As Long
Sub SendEMail()
Dim Email As String, Subj As String
Dim Msg As String, URL As String
Dim r As Integer, x As Double
Dim katie As Variant

Email =

' Message subject
Subj = "Price List"

' Compose the message
Worksheets("Sheet1").Activate
ActiveSheet.UsedRange.Copy

Application.SendKeys "{Tab}{Tab}{Tab}{Tab}{Tab}^{End}{Return}{Return}^v " <== "I would like to paste the range in the body but don't know how to do that."


Msg = <==



' Replace spaces with %20 (hex)
Subj = Application.WorksheetFunction.Substitute(Subj, " ", "%20")
Msg = Application.WorksheetFunction.Substitute(Msg, " ", "%20")

' Replace carriage returns with %0D%0A (hex)
Msg = Application.WorksheetFunction.Substitute(Msg, vbCrLf, "%0D%0A")
' Create the URL
URL = "mailto:" & Email & "?subject=" & Subj & "&body=" & Msg

' Execute the URL (start the email client)
ShellExecute 0&, vbNullString, URL, vbNullString, vbNullString, vbNormalFocus





End Sub

Is there any way to paste the range as the body of the message other then sendkey?

Thanks.

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
Send a Sheet as body of Outlook Email David Ackerman on cape cod Excel Discussion (Misc queries) 0 March 19th 10 03:11 PM
Fw: send two or more files with Excel and Outlook Express Infosistem Excel Discussion (Misc queries) 1 August 17th 06 05:27 PM
Excel(with hyperlinks) as a message body of outlook mail hans Excel Discussion (Misc queries) 1 July 7th 06 12:35 PM
How do use outlook express to send email in office 2003 How do use outlook express to send email Excel Discussion (Misc queries) 1 July 19th 05 12:35 PM
Send to Outlook 2000 not Outlook Express Jimbo Excel Discussion (Misc queries) 2 January 4th 05 08:19 PM


All times are GMT +1. The time now is 04:19 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"