HTMLBody Property of Outlook MailItem

J

Judy

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 = "<HTML><BODY><FONT SIZE=" & """12""" & ">" & "Test" &
"</BODY></HTML>" It evaluates as <HTML><BODY><FONT
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top