A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook - Using Forms
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

HTMLBody Property of Outlook MailItem



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 19th 06, 05:28 AM posted to microsoft.public.outlook.program_forms
Judy
external usenet poster
 
Posts: 1
Default HTMLBody Property of Outlook MailItem

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.

  #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.

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Creating a new mailItem with a signature, and a modified HTMLBody Peter Reinhold Add-ins for Outlook 6 November 10th 06 04:52 PM
MailItem.UserProperties property itself does not exist? (0x8004010F error) Jeff Outlook and VBA 2 October 17th 06 02:58 PM
MailItem To property and display name Olivier Langlois Outlook and VBA 1 September 11th 06 06:10 PM
Outlook 2003 vs. 2000 / HTMLBody Property Fred Block Outlook and VBA 5 August 7th 06 08:04 PM
Set MailItem.Sender Property Joshua Ellul Add-ins for Outlook 2 June 8th 06 07:30 PM


All times are GMT +1. The time now is 10:12 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.