+ Reply to Thread
Results 1 to 12 of 12

Change Font formatting mid-sentence of HTMLBody Outlook mail

  1. #1
    Registered User
    Join Date
    07-16-2014
    Location
    Washington
    MS-Off Ver
    2010
    Posts
    37

    Change Font formatting mid-sentence of HTMLBody Outlook mail

    Hello everyone!

    I've got the following code (thanks in part to some helpful folks here) which is working but I'm having a tough time changing the font formatting. I'm trying to add code to change the font color after Red to another color but have not found any examples online. Everything mentions the paragraph styling which when I use will put the text on a new paragraph.

    --Also, how can I space the table elements? Currently there is almost no spacing and I'd want to put a few tabs between the columns.

    Please Login or Register  to view this content.
    Last edited by askpcguy; 07-31-2014 at 05:17 PM. Reason: Solved

  2. #2
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474

    Re: Change Font formatting mid-sentence of HTMLBody Outlook mail

    To change the colour for text within a sentence, try...

    <span style="color: rgb(0, 0, 102);">your text</span>

    Change the colour, accordingly.

    Hope this helps!

  3. #3
    Registered User
    Join Date
    07-16-2014
    Location
    Washington
    MS-Off Ver
    2010
    Posts
    37

    Re: Change Font formatting mid-sentence of HTMLBody Outlook mail

    Trying that give an error on color.

    Please Login or Register  to view this content.
    However this works but the text is on another line
    Please Login or Register  to view this content.
    Last edited by askpcguy; 07-31-2014 at 12:22 AM. Reason: forgot code blocks

  4. #4
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474

    Re: Change Font formatting mid-sentence of HTMLBody Outlook mail

    Try...

    "<p>This is another <span style=""color:rgb(31,73,125);"">sentence</span> where one word has a different font color.</p>"

  5. #5
    Registered User
    Join Date
    07-16-2014
    Location
    Washington
    MS-Off Ver
    2010
    Posts
    37

    Re: Change Font formatting mid-sentence of HTMLBody Outlook mail

    That works but still puts the 2nd color text on a different line. Happens even if I remove the
    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474

    Re: Change Font formatting mid-sentence of HTMLBody Outlook mail

    Try replacing...

    Please Login or Register  to view this content.
    with

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    07-16-2014
    Location
    Washington
    MS-Off Ver
    2010
    Posts
    37

    Re: Change Font formatting mid-sentence of HTMLBody Outlook mail

    Quote Originally Posted by Domenic View Post
    Try replacing...

    Please Login or Register  to view this content.
    with

    Please Login or Register  to view this content.
    That did the trick! Here's my final code. Now I've got to find a way to add some space between the table columns. I'd think by now I owe someone a lunch!!!
    Please Login or Register  to view this content.

  8. #8
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474

    Re: Change Font formatting mid-sentence of HTMLBody Outlook mail

    It doesn't look that your code actually creates a table consisting of two columns, which is what I think you want. Try to adopt the following code, which creates a table consisting of 2 rows and 2 columns...

    Please Login or Register  to view this content.
    Notice that the each <tr>...</tr> refers to one row, and each <td>...</td> refers to one column. Adjust the widths for each column, accordingly. And, you may want to adjust the cellpading and cellspacing.

    Hope this helps!

  9. #9
    Registered User
    Join Date
    07-16-2014
    Location
    Washington
    MS-Off Ver
    2010
    Posts
    37

    Re: Change Font formatting mid-sentence of HTMLBody Outlook mail

    Thank you Domenic, working on this now. Is there a tag to allow a table cell to word wrap? Or would that happen on its own?

  10. #10
    Forum Expert
    Join Date
    06-18-2004
    Location
    Canada
    MS-Off Ver
    Office 2016
    Posts
    1,474

    Re: Change Font formatting mid-sentence of HTMLBody Outlook mail

    Unless otherwise specified, I think it would happen on it's own...

  11. #11
    Registered User
    Join Date
    07-16-2014
    Location
    Washington
    MS-Off Ver
    2010
    Posts
    37

    Re: Change Font formatting mid-sentence of HTMLBody Outlook mail

    Cool beans, I could use a break! I'm slowly adding your new table layout into the VBA and its working.

  12. #12
    Registered User
    Join Date
    07-16-2014
    Location
    Washington
    MS-Off Ver
    2010
    Posts
    37

    Re: Change Font formatting mid-sentence of HTMLBody Outlook mail

    Just an update, been hammering away at VBA but I can say the output looks polished and great. The VBA code however is totally different. Posting code here should anyone want to mess with tables, font formatting within the HTMLBody for an Outlook email.

    Please Login or Register  to view this content.

+ 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. Change font size of text in mail VBA code
    By ExcelFailure in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-05-2013, 12:51 PM
  2. Change of formatting in a sentence to subscript
    By Sc0tt1e in forum Word Programming / VBA / Macros
    Replies: 0
    Last Post: 06-28-2013, 05:50 AM
  3. Change of formatting in a sentence to subscript
    By Sc0tt1e in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-28-2013, 05:50 AM
  4. change e-mail font default color
    By mvan in forum Excel General
    Replies: 1
    Last Post: 04-04-2006, 06:35 PM
  5. outlook htmlbody
    By Erin in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-06-2005, 03:06 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