Results 1 to 9 of 9
  1. #1
    Bronze Lounger
    Join Date
    Sep 2007
    Posts
    1,203
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi,

    If I change the following line:

    .HTMLBody = "<FONT color=#000000 face=Times New Roman size=3>" & _

    to size=2, then the whole body text is reduced except for inside the table. How can I decrease the font size inside the table?

    Code:
    With objMail
    .To = "N@aol.com"
    .Subject = "Payments - " & Range("E7") & " - " & Range("E9")
    .HTMLBody = "<FONT color=#000000 face=Times New Roman size=3>" & _
    Range("E5") & "" & _
    "Number: - " & "" & Range("E7") & "" & _
    "Name: - " & "" & Range("E9") & "" & _
    "<html><table border=1 cellpadding=1>" & _
    "<tr><td align=center>" & Range("A22") & "</td><td align=center>" & Range("B22") & "</td><td align=center>" & Range("C22") & "</td><td align=center>" & "Invalid Acc No" & "</td><td align=center>" & Range("E22") & "</td><td align=center>" & Range("F22") & "</td><td align=center>" & Range("G22") & "</td><td align=center>" & Range("H22") & "</td><td align=center>" & Range("I22") & "</td><td align=center>" & Range("J22") & "</td></tr><tr></tr>" & _
    "<tr><td align=center>" & Range("A23") & "</td><td align=center>" & Format(Range("B23"), "dd/mm/yy") & "</td><td align=center>" & Range("C23") & "</td><td align=left>" & Range("D23") & "</td><td align=left>" & Range("E23") & "</td><td align=left>" & Range("F23") & "</td><td align=right>" & Format(Range("G23"), "#,##0.00") & "</td><td align=center>" & Range("H23") & "</td><td align=center>" & Range("I23") & "</td><td align=left>" & Range("J23") & "</td></tr>" & _
    "</table>" & _
    "Return to source reference: - " & Range("E11") & "" & _
    "Further Information: - " & Range("E13") & "</html>"
    .Send
    End With
    Thanks

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    Specify the font size in every cell...

  3. #3
    Bronze Lounger
    Join Date
    Sep 2007
    Posts
    1,203
    Thanks
    0
    Thanked 0 Times in 0 Posts
    So that cannot be done for the whole table..... OUCH

  4. #4
    Platinum Lounger
    Join Date
    Feb 2001
    Location
    Weert, Limburg, Netherlands
    Posts
    4,812
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Of course you can, just wrap the entire table with the font tag (not tested in outlook, tested in a browser):
    <font size="1">
    'table goes here
    </font>
    Jan Karel Pieterse
    Microsoft Excel MVP, WMVP
    www.jkp-ads.com
    Professional Office Developers Association

  5. #5
    Bronze Lounger
    Join Date
    Sep 2007
    Posts
    1,203
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The main object here is to take a table of 10 wide by 21 long from excel to outlook. The table looks fine on screen in the email, but does not print as desired. This will be used as a form on mass, and each one will be printed by the recipient (not my choice).

    What I need is to be able to control the table size so that it fits inside the margins of the email, and is reduced accordingly to fit appropriately.

    At present (when printed, but not on screen), each space within each cell is causing the cell text to wrap onto more than one line, which I would rather avoid.

    In short, I need to control the email so that it fits to 1x1 page, reduced in size as required. Is there a way to do this?

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    You can specify the width of a table and of individual cells as a percentage, e.g.

    <table border="1" cellpadding="1" width="100%">
    <tr>
    <td align="center" width="25%">...

  7. #7
    Bronze Lounger
    Join Date
    Sep 2007
    Posts
    1,203
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm running into trouble here.

    Are there limitations of how big a table can be and with how much formatting?

    [attachment=83858:statemen...ocomplex.GIF]
    Attached Images Attached Images

  8. #8
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    If you get this error during Edit | Replace, your string may have become too long.

    I'd send the table as an attachment instead of trying to cram it into the body of the e-mail.

  9. #9
    Bronze Lounger
    Join Date
    Sep 2007
    Posts
    1,203
    Thanks
    0
    Thanked 0 Times in 0 Posts
    <If you get this error during Edit | Replace, your string may have become too long.

    Yes, ridiculously long!

    I'd send the table as an attachment instead of trying to cram it into the body of the e-mail.

    Not an option. We need to be able to quickly print an email, preferably on one page. The object of the exercise is to get away from the various different types of attachments that we currently receive.

    Anyway......

    I have managed to get a considerably smaller table using the following:

    .HTMLBody = "<FONT color=#000000 face=Times New Roman size=3>" & "<html><table border=1>" & _
    "<tr><td align=center><font size=-2>" & Range("A22") & "</td>

    Note the negative font size and the non use of "".

    So basically controlling the size of each cell. I was not able to do it at table level as per "pieterse" suggestion. Hay HO. Also I gave up on trying to control the width of the table and cells, as the string was too long to cope. I do not have </font> tags either (for the same reason, but......... what I do have seems to work.

    The table is a little smaller than I would like, but it appears to fit to one print page. I may need to revisit this at a later time, but for now it will do.

    I may be back , but for now, Thanks.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •