Results 1 to 4 of 4

Thread: Sending a single worksheet as an Outlook body

  1. #1

    Thread Starter
    Member
    Join Date
    Jul 2003
    Posts
    35

    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

  2. #2
    Addicted Member
    Join Date
    Aug 2003
    Location
    houston
    Posts
    185
    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

  3. #3

    Thread Starter
    Member
    Join Date
    Jul 2003
    Posts
    35
    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

  4. #4
    Addicted Member
    Join Date
    Aug 2003
    Location
    houston
    Posts
    185
    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
  •  



Click Here to Expand Forum to Full Width