+ Reply to Thread
Results 1 to 2 of 2

Text box does not keep formatting when macro creates emails

  1. #1
    Registered User
    Join Date
    06-16-2021
    Location
    Texas
    MS-Off Ver
    2013
    Posts
    1

    Exclamation Text box does not keep formatting when macro creates emails

    I have a macro that creates multiple emails, and the text that is in the text box is what is pulled to the email. However when the emails are created, the formatting (i.e. if words are bolded) do not stay bolded. Also when these emails are created they do not automatically have my signature in them.
    The following is currently the VBA written:

    Please Login or Register  to view this content.
    Moderator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #2 requires code tags. I have added them for you this time because you are a new member. --6StringJazzer
    Last edited by 6StringJazzer; 06-16-2021 at 11:30 AM.

  2. #2
    Administrator 6StringJazzer's Avatar
    Join Date
    01-27-2010
    Location
    Tysons Corner, VA, USA
    MS-Off Ver
    MS365 Family 64-bit
    Posts
    24,666

    Re: Text box does not keep formatting when macro creates emails

    There are a couple of problems here. First, the Text property of a textbox does not include any formatting. Second, the .body attribute of an email item does not include any formatting; it is for plain text. You need to copy the textbox text, and paste it into .HTMLbody. HTML requires formatting tags, so you can't just assign the text, you have to paste it and let the application do the conversion for you.

    You need to add something like this but I have not tested it. You will also need to set a reference to Microsoft Word.

    Please Login or Register  to view this content.

    If you get really stuck let me know and I'll try to find the time to develop an example.
    Jeff
    | | |會 |會 |會 |會 | |:| | |會 |會
    Read the rules
    Use code tags to [code]enclose your code![/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. Maintaining Excel cell formatting when Macro creates an e-mail
    By heferkaye in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-02-2016, 08:54 AM
  2. How to repeat macro that creates a text file
    By Rightside_15 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 02-17-2014, 11:13 AM
  3. Replies: 1
    Last Post: 10-19-2012, 08:54 PM
  4. Replies: 11
    Last Post: 02-13-2012, 06:10 PM
  5. Macro That Creates Text Doc in specific folder based on cell value
    By stevedes7 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 12-16-2009, 08:30 AM
  6. Sending macro emails using excel: Send emails with their passwords.
    By loveisblind in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-12-2009, 03:16 PM
  7. Macro that inputs text and creates a cell that uses it as both its text and its name
    By petalred in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-18-2009, 12:10 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