Results 1 to 5 of 5

Excel VBA outlook - Range in mail body

Threaded View

  1. #1
    Registered User
    Join Date
    09-22-2013
    Location
    Bangalore
    MS-Off Ver
    Excel 2010
    Posts
    2

    Excel VBA outlook - Range in mail body

    Hi,

    I am trying to send email (outlook) through excel VBA code. I am able to send mail with attachment using following code But I want to put range of cells in message body with format. I have a piviot in the excel which i want to copy in mail body.

    Please help!

      Dim OutApp As Object
      Dim OutMail As Object
      
      Set OutApp = CreateObject("Outlook.Application")
      Set OutMail = OutApp.CreateItem(0)
       
      Dim sbody As String
      Dim prange As Range
    
        On Error Resume Next
       ' Change the mail address and subject in the macro before you run it.
        With OutMail
            .To = "<email id>"
            .CC = ""
            .BCC = ""
            .Subject = "Test mail"
             .Body = "Hello World!"
                    
            .Attachments.Add ActiveWorkbook.FullName
            
             ' display the mail.
            .display
            
            ' .Send
        End With
        
        'On Error GoTo 0
    
        Set OutMail = Nothing
        Set OutApp = Nothing
    Last edited by jeffreybrown; 09-22-2013 at 01:55 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Read/Export table from Outlook mail body to Excel using VBA
    By pradeepdeepu_001 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-23-2013, 06:48 AM
  2. Send e-mail with image on body (.html) on e-mail manager <> outlook
    By mariotnc in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-05-2012, 09:28 PM
  3. Replies: 7
    Last Post: 08-11-2012, 02:39 PM
  4. Replies: 1
    Last Post: 07-07-2006, 07:40 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1