+ Reply to Thread
Results 1 to 4 of 4

How to generate an outlook message with the content from a particular worksheet.

  1. #1
    Registered User
    Join Date
    12-12-2014
    Location
    India
    MS-Off Ver
    10
    Posts
    27

    How to generate an outlook message with the content from a particular worksheet.

    I have a Macro developed which gives me lot of graphs and tables in multiple worksheets. As there is lot of data, I have selected specific data and stored in one of the worksheet. Now I want to generate outlook message with the content only from that particular worksheet instead of sending that whole worksheet or spreadsheet.
    I have created one button on that sheet. Once the user clicked on that particular worksheet outlook message should get generate automatically.

    For more details please refer the attachment.

    Can anyone please help me on this. Thanks!

    NOTE:
    The body of the email should take the text as well as pictures from the selected range from the worksheet.
    Attached Files Attached Files
    Last edited by DURGESH88; 12-26-2014 at 03:44 AM.

  2. #2
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: How to generate an outlook message with the content from a particular worksheet.

    Check out Ron's site. There are lots of good examples there.
    David
    (*) Reputation points appreciated.

  3. #3
    Registered User
    Join Date
    12-12-2014
    Location
    India
    MS-Off Ver
    10
    Posts
    27

    Re: How to generate an outlook message with the content from a particular worksheet.

    Thanks for the info:
    I used below code from Ron's site and its working for me to get the text as well as pictures from the respective worksheet. However I am facing a small problem. With current code email is directly shoot and not able to just open into the outlook message. I did try to change the keyword as ".Display" instead of ".Send". But its not working for me. Can you please help me on this.


    Dim AWorksheet As Worksheet
    Dim Sendrng As Range
    Dim rng As Range
    On Error GoTo StopMacro
    With Application
    .ScreenUpdating = False
    .EnableEvents = False
    End With

    'Fill in the Worksheet/range you want to mail
    'Note: if you use one cell it will send the whole worksheet
    Set Sendrng = Worksheets("Sheet1").Range("A5:K60")

    'Remember the activesheet
    Set AWorksheet = ActiveSheet

    With Sendrng

    ' Select the worksheet with the range you want to send
    .Parent.Select

    'Remember the ActiveCell on that worksheet
    Set rng = ActiveCell

    'Select the range you want to mail
    .Select

    ' Create the mail and send it
    ActiveWorkbook.EnvelopeVisible = True
    With .Parent.MailEnvelope

    ' Set the optional introduction field thats adds
    ' some header text to the email body.
    .Introduction = "Breaking News: Durgesh la bhook lagali"

    With .Item
    .To = "abc.xyz@test.com"
    .CC = ""
    .BCC = ""
    .Subject = "Auto Generated Report"

    .Send 'I used .Display as well but its not working,. .Send is working
    End With

    End With

    'select the original ActiveCell
    rng.Select
    End With

    'Activate the sheet that was active before you run the macro
    AWorksheet.Select

    StopMacro:
    With Application
    .ScreenUpdating = True
    .EnableEvents = True
    End With
    ActiveWorkbook.EnvelopeVisible = False

    Thanks for your help on this.
    Last edited by DURGESH88; 12-28-2014 at 11:45 PM.

  4. #4
    Forum Expert Tinbendr's Avatar
    Join Date
    06-26-2012
    Location
    USA
    MS-Off Ver
    Office 2010
    Posts
    2,138

    Re: How to generate an outlook message with the content from a particular worksheet.

    But its not working for me.
    What does this mean exactly?

    You should replace Send with Display.

    Also comment out
    Please Login or Register  to view this content.
    Please use code tags when posting code.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Worksheet change event code to display message box based on active cell offset content
    By Nitefox in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 03-12-2014, 02:52 PM
  2. Extracting mail message(outlook) table in the message body
    By andywsw in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-12-2012, 10:14 PM
  3. Replies: 5
    Last Post: 04-04-2010, 06:26 PM
  4. Auto Generate MS Outlook Email Message from Excel
    By LordMarcus in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-10-2008, 08:35 AM
  5. Excel Worksheet Opens in Outlook Message
    By Perry in forum Excel General
    Replies: 1
    Last Post: 11-18-2005, 08:10 PM

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