Send Excel data to Outlook in message area

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • atljpe
    New Member
    • Jan 2007
    • 11

    Send Excel data to Outlook in message area

    Simply looking for a code that will take data from an excel spreadsheet to inline text in a new message in outlook. Not an attachment, that I can do. I Just cannot figure out how to send data to outlook in the message area via VBA.
  • iburyak
    Recognized Expert Top Contributor
    • Nov 2006
    • 1016

    #2
    1. Go through Excel document and loop through all rows and columns to collect data into a variable. Let’s say this variable will be sExcelData

    2. Send collected text via e-mail
    [PHP]
    Dim objOutlook
    Dim objMailItem
    set objOutlook = createobject("O utlook.Applicat ion")
    Set objMailItem = objOutlook.Crea teItem(olMailIt em)

    With objMailItem
    .To = "e-mail address"
    .Subject = "put subject here"
    .Body = sExcelData
    .Send
    End With

    Set objOutlook = Nothing
    Set objMailItem = Nothing[/PHP]

    Comment

    • atljpe
      New Member
      • Jan 2007
      • 11

      #3
      iburyak......Th at was perfect....than ks from atljpe

      Originally posted by iburyak
      1. Go through Excel document and loop through all rows and columns to collect data into a variable. Let’s say this variable will be sExcelData

      2. Send collected text via e-mail
      [PHP]
      Dim objOutlook
      Dim objMailItem
      set objOutlook = createobject("O utlook.Applicat ion")
      Set objMailItem = objOutlook.Crea teItem(olMailIt em)

      With objMailItem
      .To = "e-mail address"
      .Subject = "put subject here"
      .Body = sExcelData
      .Send
      End With

      Set objOutlook = Nothing
      Set objMailItem = Nothing[/PHP]

      Comment

      Working...