|
-
Aug 29th, 2003, 07:37 AM
#1
Thread Starter
Member
Sending a single worksheet as an Outlook body
I would like to be able to send a single sheet (not whole workbook) as the body (not attachment) of an Outlook mail. This is the best I can do but it only attaches the sheet to the mail:
Code:
Worksheets("Redemptions").Select
ActiveSheet.Copy
Application.Dialogs(xlDialogSendMail).Show "[email protected]", "My Subject"
I would be grateful for any ideas
-
Aug 29th, 2003, 09:48 AM
#2
Addicted Member
vbscode
Sub SendMessage(Optional AttachmentPath)
Dim myrange As Range
On Error Resume Next
Set myrange = Range("EMailList").Offset(1, 0)
' Create the Outlook session.
Set objOutlook = New Outlook.Application
' Create the message.
Set objOutlookMsg = objOutlook.CreateItem(olMailItem)
With objOutlookMsg
'--- Begin looping through all the e-mail addresses until
' a blank cell is hit.
While myrange.Text <> ""
Set objOutlookRecip = .Recipients.Add(myrange.Text)
Set myrange = myrange.Offset(1, 0)
Wend
If Not correction Then
CustomerMessage = "West Prices"
Else
CustomerMessage = "West Prices"
End If
Debug.Print CustomerMessage
objOutlookRecip.Type = olTo
' Set the Subject, Body, and Importance of the message.
.Subject = CustomerMessage
.Body = CustomerMessage
.Importance = olImportanceHigh 'High importance
' Add attachments to the message.
AttachmentPath = Range("AttachmentPath")
If Not IsMissing(AttachmentPath) Then
Set objOutlookAttach = .Attachments.Add(AttachmentPath)
End If
.Send '--- Send the message.
End With
'--- Remove the message and Outlook application from memory.
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
End Sub
this uses microsoft outlook
maybe you could pick thru this i would select the area into a variable and use that for body
-
Aug 29th, 2003, 09:59 AM
#3
Thread Starter
Member
Thanks
I sussed it
BTW This site is very good for demonstrating how to send excel sheets as the body of an outlook mail
http://www.dicks-clicks.com/excel/olSending.htm
It's not a porn site don't worry
-
Aug 29th, 2003, 10:12 AM
#4
Addicted Member
its about what I said
Had me worried when i hit the site
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|