Formatting CDO email messages

  • Thread starter Thread starter Ed Richter
  • Start date Start date
E

Ed Richter

Was wondering is there any easy ways to format a CDO mail message? For instance, I'd like the responses shown in bold as the line below attempts to do:

MailBody = sMailBody & "First name was: " & " <B> " & old_F_name & " </B> First name now is: " & " " & new_F_name & " <B> " & " </B>" & vbNewLine & vbNewLine

But the <B> html delimiters instead just appear as literal code? Kind of thought that might happen.

Is there a way to put responses into a table in the message? Just trying to come up with a way to make responses stand out.
 
See:

http://www.15seconds.com/Issue/980429.htm

or in the IE address bar type:

? Sending HTML email via CDO

--

==============================================
Thomas A. Rowe (Microsoft MVP - FrontPage)
WEBMASTER Resources(tm)

FrontPage Resources, Forums, WebCircle,
MS KB Quick Links, etc.
==============================================


Was wondering is there any easy ways to format a CDO mail message? For
instance, I'd like the responses shown in bold as the line below attempts to
do:

MailBody = sMailBody & "First name was: " & " <B> " & old_F_name & " </B>
First name now is: " & " " & new_F_name & " <B> " & " </B>" & vbNewLine &
vbNewLine

But the <B> html delimiters instead just appear as literal code? Kind of
thought that might happen.

Is there a way to put responses into a table in the message? Just trying to
come up with a way to make responses stand out.
 
You need to tell the CDO object that the body section
consists of HTML. For CDONTS.NewMail, this requires:

Set myMail = CreateObject("CDONTS.NewMail")
myMail.BodyFormat = 0 ' Means CdoBodyFormatHTML
myMail.MailFormat = 0 ' Means CdoMailFormatMime

For CDO.Message, you save the HTML in the HTMLBody
property rather than the TextBody property.

Jim Buyens
Microsoft FrontPage MVP
http://www.interlacken.com
Author of:
*----------------------------------------------------
|\---------------------------------------------------
|| Microsoft Office FrontPage 2003 Inside Out
||---------------------------------------------------
|| Web Database Development Step by Step .NET Edition
|| Microsoft FrontPage Version 2002 Inside Out
|| Faster Smarter Beginning Programming
|| (All from Microsoft Press)
|/---------------------------------------------------
*----------------------------------------------------
 

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

Similar Threads

CDONTS Question 3
CDO Message 1
Cannot send mail in Office 5
Email notification including specific cell data 2
CDO Mail Formatting 2
Access 2003 and CDO for email 2
Combine Excel Emails 1
Sending mail via CDO 2

Back
Top