ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Specify Font Color (https://www.excelbanter.com/excel-programming/315235-specify-font-color.html)

Todd huttenstine

Specify Font Color
 
hey

The below code creates an email message. It embeds a
picture and it also creates a subject line and body and
specifys a to address. How do you make it specify font
color?


Dim szHTML As String
Dim msg As Outlook.MailItem
Dim ol, MailSendItem, olns, olMailItem
Set ol = CreateObject("Outlook.Application")
Set MailSendItem = ol.CreateItem(olMailItem)



szHTML = szHTML & "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD
HTML 4.0 Transitional//EN"""
szHTML = szHTML & "<HTML<HEAD"
szHTML = szHTML & "<META content=""text/html;
charset=iso-8859-1""http-equiv=Content-Type"
szHTML = szHTML & "<META content=""MSHTML
5.00.2314.1000""name=GENERATOR</HEAD"
szHTML = szHTML & "<DIV<IMG align=baseline alt=""""
border=0 hspace=0 "
szHTML = szHTML & "src=""G:\Sales OPs
CarTn\Reports\Templates\Verizon.gif""</DIV</BODY</HTML"
szHTML = szHTML & "Carolina/Tennessee Marketing
Update " & "</a</font </b<br<BODY" & "Metrics and
Analysis"

'"<B<font face=Arial color="#0000FF"<a href=" _ &
Report_PDF & "" & ReportDate & "</a</font</b<br"

'Set msg = Application.CreateItem(olMailItem)
MailSendItem.To
= "
MailSendItem.Subject = "Indirect Productivity -
October 2004 "
MailSendItem.HTMLBody = szHTML
MailSendItem.Send

david mcritchie

Specify Font Color
 

You appear to have the font in a meta tag
You are mising the <body tag

I see the following in the properties of an email sent to myself.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"
<HTML<HEAD
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1"
<META content=3D"MSHTML 6.00.2800.1476" name=3DGENERATOR
<STYLE</STYLE
</HEAD
<BODY bgColor=3D#00ff00
---
HTH,
David McRitchie, Microsoft MVP - Excel [site changed Nov. 2001]
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"Todd Huttenstine" wrote in message ...
hey

The below code creates an email message. It embeds a
picture and it also creates a subject line and body and
specifys a to address. How do you make it specify font
color?


Dim szHTML As String
Dim msg As Outlook.MailItem
Dim ol, MailSendItem, olns, olMailItem
Set ol = CreateObject("Outlook.Application")
Set MailSendItem = ol.CreateItem(olMailItem)



szHTML = szHTML & "<!DOCTYPE HTML PUBLIC ""-//W3C//DTD
HTML 4.0 Transitional//EN"""
szHTML = szHTML & "<HTML<HEAD"
szHTML = szHTML & "<META content=""text/html;
charset=iso-8859-1""http-equiv=Content-Type"
szHTML = szHTML & "<META content=""MSHTML
5.00.2314.1000""name=GENERATOR</HEAD"
szHTML = szHTML & "<DIV<IMG align=baseline alt=""""
border=0 hspace=0 "
szHTML = szHTML & "src=""G:\Sales OPs
CarTn\Reports\Templates\Verizon.gif""</DIV</BODY</HTML"
szHTML = szHTML & "Carolina/Tennessee Marketing
Update " & "</a</font </b<br<BODY" & "Metrics and
Analysis"

'"<B<font face=Arial color="#0000FF"<a href=" _ &
Report_PDF & "" & ReportDate & "</a</font</b<br"

'Set msg = Application.CreateItem(olMailItem)
MailSendItem.To
= "
MailSendItem.Subject = "Indirect Productivity -
October 2004 "
MailSendItem.HTMLBody = szHTML
MailSendItem.Send





All times are GMT +1. The time now is 04:22 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com