+ Reply to Thread
Results 1 to 8 of 8

Macro to Send Email with text in body

  1. #1
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Ventura, united States
    MS-Off Ver
    Excel 2010
    Posts
    346

    Macro to Send Email with text in body

    The code below works pretty well at bringing up an email, or even sending. Does anyone know how to write in the body of the email? I
    previously had some code that would paste inside the email, but it would overwrite the autosignature which was annoying. At the moment I just want to have the same few sentences put in the body, but I want to keep the signature at the bottom.


    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Ventura, united States
    MS-Off Ver
    Excel 2010
    Posts
    346

    Re: Macro to Send Email with text in body

    Bump no reply

  3. #3
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Macro to Send Email with text in body

    Hi,

    All you need to do is to add the subject property and fill it up with the string.

    I have added one single line of code to yours. Hope this helps.

    Happy Computing.

    Please Login or Register  to view this content.

  4. #4
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Ventura, united States
    MS-Off Ver
    Excel 2010
    Posts
    346

    Re: Macro to Send Email with text in body

    That code runs fine, but it erases my autosignature. Do you know of any way to avoid this?

  5. #5
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Macro to Send Email with text in body

    Hi,

    does your signature contain plain text or a mix of text and images ?

    If it is just text , then we can simply append it to the message body.
    Happy Computing ,

    Xlbiznes.

    To show your appreciation please click *

  6. #6
    Forum Contributor
    Join Date
    09-25-2012
    Location
    Ventura, united States
    MS-Off Ver
    Excel 2010
    Posts
    346

    Re: Macro to Send Email with text in body

    It's a mix of text and images and it uses different font colors. It automatically comes up with the email until I put in the "Body" line of code.

  7. #7
    Valued Forum Contributor xlbiznes's Avatar
    Join Date
    02-22-2013
    Location
    Bahrain
    MS-Off Ver
    Excel 2007
    Posts
    1,223

    Re: Macro to Send Email with text in body

    In that case you need to search for a file mysig.htm. This would be a HTML style file. Get the contents of this file into a string and replace .Body with .HTMLBody. Append the message with the contents of mysig.htm. Try it out.

  8. #8
    Valued Forum Contributor
    Join Date
    08-29-2012
    Location
    In lockdown
    MS-Off Ver
    Excel 2010 (2003 to 2016 but 2010 for choice)
    Posts
    1,766

    Re: Macro to Send Email with text in body

    Two suggestions:
    1. I had a similar problem trying to get workbooks in a folder emailed through Outlook. See the code in my thread to see if you can take ideas from that: http://www.excelforum.com/excel-prog...closed-wb.html
    2. There is a very good page covering Excel VBA & Outlook on Ron de Bruins website. It also contains example workbooks you can download. See here: http://www.rondebruin.nl/sendmail.htm

    Hope that this is of some help to you.
    *******************************************************

    HELP WANTED! (Links to Forum threads)
    Trying to create reusable code for Custom Events at Workbook (not Application) level

    *******************************************************

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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