+ Reply to Thread
Results 1 to 3 of 3

Text align cells in table being created in HTML outlook mail item

Hybrid View

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

    Text align cells in table being created in HTML outlook mail item

    Hi,

    I've got the following code and have been trying to make the cells in column 1 align TOP LEFT but haven't been able to. I really appreciate the help!

        .HTMLBody = "<HTML><BODY><H2><I>"
        .HTMLBody = .HTMLBody & "<P Style=""font-family:Arial;font-size:18pt;color:red;"">FlashAlert"
        .HTMLBody = .HTMLBody & "<Span Style=""Color:RGB(31,73,125);""> - Important IT Service Bulletin</SPAN></H2></P>"
        .HTMLBody = .HTMLBody & "<Span Style='font-family:Arial;font-size:12pt;Color:blue'>" & MyText & "</SPAN></I>"
        .HTMLBody = .HTMLBody & "<table style=""font-family: Arial; font-size: 10pt; text-align: left;"" border=""0""" & _
            "cellpadding=""1"" cellspacing=""8"">" & "<TDBODY>" & "<TR>" & _
            "<TD Style=""font-weight: bold; width: 250px;text-align: left;vertical-align: top;"">Incident Report Detail:</TD>" & _
            "<TD Style=""width: 300px""><a href=""" & oLinky & _
            TextBox1.Value & """>" & "<Span Style=""font-size: 12pt;"">" & TextBox1.Value & "</SPAN>" & "</a></TD>" & "</TR>" & _
            "<TR><TD><Span Style=""font-weight: bold;text-align: left;vertical-align: top;"">Status:</SPAN></TD>" & "<TD><B>" & ComboBox1.Text & "</B></TD>" & "</TR>" & _
            "<TR><TD><Span Style=""font-weight: bold;text-align: left;vertical-align: top;"">Date/Time Reported:</SPAN></TD>" & "<TD>" & TextBox2.Text & "</TD>" & "</TR>" & _
            "<TR><TD><Span Style=""font-weight: bold;text-align: left;vertical-align: top;"">Impact Summary:</SPAN></TD>" & "<TD>" & TextBox3.Text & "</TD>" & "</TR>" & _
            "<TR><TD><Span Style=""font-weight: bold;text-align: left;vertical-align: top;"">Locations Impacted:</SPAN></TD>" & "<TD>" & TextBox4.Text & "</TD>" & "</TR>" & _
            "<TR><TD><Span Style=""font-weight: bold;text-align: left;vertical-align: top;"">Incident Manager:</SPAN></TD>" & "<TD>" & TextBox5.Text & "</TD>" & "</TR>" & _
            "<TR><TD><Span Style=""font-weight: bold;text-align: left;vertical-align: top;"">Actions / Progress:</SPAN></TD>" & "<TD>" & TextBox6.Text & "</TD>" & "</TR>" & _
            "<TR><TD><Span Style=""font-weight: bold;text-align: left;vertical-align: top;"">Root Cause:</SPAN></TD>" & "<TD><B>" & TextBox7.Text & "</B></TD>" & "</TR>" & "</TABLE><BR><BR><I><Span Style='font-family:Arial;font-size:9pt;Color:red'>" & MyFooter & "</I></BODY></HTML>"
        .Importance = 2
    Last edited by askpcguy; 08-13-2014 at 05:19 PM. Reason: solved

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: Text align cells in table being created in HTML outlook mail item

    You would probably be better putting this in the outlook subforum (or even on a HTML forum) but for what it's worth that code appears to provide top left alignment when I try it. Although I have seen example of setting the style as part of the TD tag, for example:

    <td style=""text-align:left;vertical-align:top;"">

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

    Re: Text align cells in table being created in HTML outlook mail item

    Perfect, did away with span style for TD Style and things look great. Thank you ragulduy! Don't know if it matters but I put the text alignment code up front then the text formatting 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. [SOLVED] How to get Merge cells with wrap text to carry over with HTML to outlook
    By bdouglas1011 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-04-2014, 09:35 PM
  2. Outlook 2007, Referencing mail Item created from outlook template
    By thusidie in forum Outlook Programming / VBA / Macros
    Replies: 2
    Last Post: 07-21-2014, 04:33 PM
  3. [SOLVED] How to copy table from Outlook mail body in to text file
    By Draconi in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-04-2013, 02:43 AM
  4. Send e-mail with image on body (.html) on e-mail manager <> outlook
    By mariotnc in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 11-05-2012, 09:28 PM
  5. align text item in listbox...
    By sal21 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-31-2006, 10:10 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