View Single Post
  #2  
Old December 27th 06, 02:46 AM posted to microsoft.public.outlook.program_forms
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default HTMLBody Property of Outlook MailItem

Try 3 instead of 12 or (recommended) use inline styles. See http://www.w3schools.com/tags/tag_font.asp

For color, you have to convert RGB to Hex values; see http://www.wurd.com/pwp_color.php

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"Judy" wrote in message oups.com...
I'm using Access to automate mailing in Outlook, and I have the message
working and can control some of the attributes--font name, bold, and
italic--but I'm having trouble with font size. I'm using the following
code with the MailItem. If I leave it out, the message body defaults
to font size 12. If I put it in, regardless of the size I specify, the
message body changes to font size 36.
oMsg.HTMLBody = "HTMLBODYFONT SIZE=" & """12""" & "" & "Test" &
"/BODY/HTML" It evaluates as HTMLBODYFONT
SIZE="12"Test/BODY/HTML, which works fine on a web page but won't
work in my Outlook message.

I also can't figure out how to get the color specified by the user of
the application. I capture the font attributes they specify for a text
box containing the message in one module in a table, then use them to
construct the HTML, but the color numbers in the Access text box don't
seem to match the colors required by HTML. Is there a translation
table somewhere?

Would appreciate any help I can get. This is my first time trying to
format Outlook messages.

Ads