+ Reply to Thread
Results 1 to 9 of 9

Excel tables into outlook email

  1. #1
    Registered User
    Join Date
    09-10-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    61

    Excel tables into outlook email

    I have a email template in my excel sheet, I do it this way as some of the fields is formulated and also it will be easier for users to amend the template.

    For example, in my workbook, I have a sheet names "email"

    In the "email" tab, I will have something like this:
    --------
    Hi all,

    Report below shows the expenses incur in department ABC for the period of Jul'2014.

    Postage 500
    Travelling 4200
    Printing 300
    Total 5000

    Thanks,
    Admin
    ---------
    Being all the bold characters are formulated to other sheets in my workbook.

    So now, how can i build a vba code to copy these range of data(all these texts and formula is only in column A1:A100) from my email tab to outlook email body?

    And I also found out there's a very useful button in outlook email that can convert the table pasted into text by paragraphs. How do I know what is the vba code for this?


    Thanks,
    Ray

  2. #2
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Excel tables into outlook email

    Please provide sample workbook for the same
    Thanks - Naveed
    -----------------------------
    If the suggestion helps you, then Click * to Add Reputation
    To Attach File: Go Advanced>>Manage Attachments>>Add Files (In Top Right Corner)>>SelectFiles>>.........Locate Your File(s)>>Upload Files>>Done (In Bottom Right)
    1. Use [code] code tags [\code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    2. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

  3. #3
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Excel tables into outlook email

    Hi, Ray,

    check the Function RangeToHTML by Ron de Bruin.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  4. #4
    Registered User
    Join Date
    09-10-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    61

    Re: Excel tables into outlook email

    Attached is just a sample file.

    I just want to copy from range A1:A11 into the body of email with the formatting and tables.
    Once pasted onto email, vba to use the function already in Outlook to convert the tables into text paragraphs.
    sample email.xlsx

    Thanks,
    Ray

  5. #5
    Registered User
    Join Date
    09-10-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    61

    Re: Excel tables into outlook email

    thanks guys
    i've managed to make use of Ron De Bruin's rangetohtml code.
    But I still struggle with one problem which is how to get the code to use convert to text in outlook?
    convertotext.png
    is there any way that i can view the codes library for outlook?

    Thanks,
    Ray

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Excel tables into outlook email

    Hi, Ray,

    Iīm afraid I donīt see a way to use as well RangeToHTML and this outlook feature. You must set a reference to Outlook in the VBE (should be Options/References).

    Ciao,
    Holger

  7. #7
    Registered User
    Join Date
    09-10-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    61

    Re: Excel tables into outlook email

    once I have pasted the range into email body inside outlook, is there a way to select that range in outlook?
    so i can put the ConvertToText in outlook.

  8. #8
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: Excel tables into outlook email

    Now try this attached file
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    09-10-2012
    Location
    Malaysia
    MS-Off Ver
    Excel 2007
    Posts
    61

    Re: Excel tables into outlook email

    Hi Naveed, i'm able to do with the copying of range to mailbody.
    but you see, when you do that, the contents that appear in the mailbody will be inside tables.

    i'm struggling now to get the table to ConvertToText.

    not sure how i can select table of what i've pasted and then use the function converttotext in mail body.

+ 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. vba pull data from outlook body of email through email or subject of mail into excel
    By breadwinner in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-01-2014, 04:37 AM
  2. export outlook 2007 email into excel with subject and body of email
    By akulka58 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-25-2013, 02:37 PM
  3. How to parse data in Outlook email using HTML version of email back to excel
    By bnasty in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 10-31-2012, 02:54 PM
  4. Replies: 2
    Last Post: 08-01-2012, 02:47 PM
  5. Email using Excel VBA and Keeping Outlook Signature on the Email
    By Shama in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-13-2009, 07:39 PM

Tags for this Thread

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