+ Reply to Thread
Results 1 to 9 of 9

VBA to BOLD portion of email in outlook

  1. #1
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Brooklyn, NY
    MS-Off Ver
    Office 365
    Posts
    1,172

    VBA to BOLD portion of email in outlook

    Hi,
    In order to make a portion of an email bold i need to use html formatting but vba sets up the email very neatly and making the whole email in html format will make it look messy unless i starts configuring every word which can take a long time. Is there a way to just format part of the email in html and the rest via standard vba?

    Please see script in below code marked in red and which i would like bolded.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: VBA to BOLD portion of email in outlook

    You couldn't have an email that is both plain text formatted and HTML formatted.

    Formatting text with HTML is not that difficult and you don't have to do it word by word.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,552

    Re: VBA to BOLD portion of email in outlook

    Try:

    Please Login or Register  to view this content.
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Brooklyn, NY
    MS-Off Ver
    Office 365
    Posts
    1,172

    Re: VBA to BOLD portion of email in outlook

    Thanks guys.
    And you're right, it's not that difficult!
    One question, when i generate the email from excel the font comes out as calibri, when it's with html i get times new roman, how do i format as calibri?

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,552

    Re: VBA to BOLD portion of email in outlook

    You're welcome. Thanks for the rep.


    http://www.w3schools.com/tags/tag_font.asp



    Please Login or Register  to view this content.

  6. #6
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Brooklyn, NY
    MS-Off Ver
    Office 365
    Posts
    1,172

    Re: VBA to BOLD portion of email in outlook

    Thank you TMS.
    This is what the email generated:
    Capture.PNG

    Thanks for the link

  7. #7
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VBA to BOLD portion of email in outlook

    kosherboy

    In the code TMS posted you need to remove the space after the < and before the >.
    If posting code please use code tags, see here.

  8. #8
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,552

    Re: VBA to BOLD portion of email in outlook

    Yes, apologies, Norie is correct. Unfortunately, the forum can be a bit snotty about posting HTML codes, particularly the "<" and ">" ... hence the extra spaces. I was expecting the editor to remove the extra spaces.

  9. #9
    Valued Forum Contributor
    Join Date
    11-27-2013
    Location
    Brooklyn, NY
    MS-Off Ver
    Office 365
    Posts
    1,172

    Re: VBA to BOLD portion of email in outlook

    Thank you Norie.
    And thanks again TMS.

+ 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. Extract the bold portion of the text in a cell
    By hfearing in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-28-2015, 07:38 PM
  2. Question -> Save portion of worksheet in PDF & Email out
    By owen_yuen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-26-2014, 05:06 PM
  3. [SOLVED] Text to Bold, sending to email/Outlook
    By Sagittariu5 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-21-2013, 09:16 AM
  4. Bold a portion of text in a cell
    By cr_ashok in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 11-30-2007, 09:28 AM
  5. Replies: 6
    Last Post: 08-15-2006, 05:30 AM
  6. [SOLVED] Bold a portion of concatenated string
    By joeeng in forum Excel General
    Replies: 1
    Last Post: 12-08-2005, 04:30 PM
  7. Excel Email: Address and portion of body in cell
    By pete3589 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-11-2005, 11: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