Results 1 to 12 of 12

Change Font formatting mid-sentence of HTMLBody Outlook mail

Threaded View

askpcguy Change Font formatting... 07-30-2014, 11:12 PM
Domenic Re: Change Font formatting... 07-30-2014, 11:55 PM
askpcguy Re: Change Font formatting... 07-31-2014, 12:22 AM
Domenic Re: Change Font formatting... 07-31-2014, 12:43 AM
askpcguy Re: Change Font formatting... 07-31-2014, 01:10 AM
Domenic Re: Change Font formatting... 07-31-2014, 07:31 AM
askpcguy Re: Change Font formatting... 07-31-2014, 09:47 PM
  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.

    Private Sub CommandButton4_Click()
      Dim OutlookApp As Object
      Dim mItem As Object
      Dim MyLink As String
      MyLink = "http://SomeWebSiteHereOrPlaceHolder="
        Set OutlookApp = CreateObject("Outlook.Application")
        Set mItem = OutlookApp.CreateItem(0)
        With mItem
        .To = "PlaceHolder"
        .Subject = "PlaceHolder"
        .HTMLBody = "<HTML><BODY><H2><I><P Style='font-family:Arial;font-size:18pt;color:red'>Example <Change font color HERE>Text #1</CHANGE></I></H2></P>"
        .HTMLBody = .HTMLBody & "<TABLE><TR><TD><B>Example Text #2</TD></B><a href=""" & MyLink & _
            TextBox1.Value & """>" & TextBox1.Value & "</a>" & _
            "<TR><TD><B>Status:</TD></TR></B>" & ComboBox1.Text & _
            "<TR><TD><B>Date/Time Reported:</TD></TR></B>" & TextBox2.Text & _
            "<TR><TD><B>Impact Summary:</TD></TR></B>" & TextBox3.Text & _
            "<TR><TD><B>Locations Impacted:</TD></TR></B>" & TextBox4.Text & _
            "<TR><TD><B>Incident Manager:</TD></TR></B>" & TextBox5.Text & _
            "<TR><TD><B>Actions / Progress:</TD></TR></B>" & TextBox6.Text & _
            "<TR><TD><B>Root Cause:</TD></TR></B>" & TextBox7.Text & _
            "</TABLE></BODY></HTML>"
        .Importance = 2
        .Display
      End With
    End Sub
    Last edited by askpcguy; 07-31-2014 at 05:17 PM. Reason: Solved

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