[thelist] CDO.Message how to reset values without recreating the object.

Tab Alleman Tab.Alleman at MetroGuide.com
Wed Nov 26 11:24:21 CST 2003


I have a routine that loops through a recordset and sends a CDO.Message
email for each record.

I have been creating the object before the loop, changing the properties
with each iteration, and then destroying the object at the end of the
loop.

Now I have a need to reset or clear the object on each iteration, but I
don't want to destroy and recreate the object each time.  Any ideas how
to do this?

If it helps I'll explain further:

Some emails are going to be HTML, and some are going to be Text.  When I
populate the .HTMLBody property of one email, then on the next email, I
populate the .TextBody property, the .HTMLBody property from the last
email is still in effect, which seems to override the .TextBody that I
really want to send.  However, setting the .HTMLBody="" or =Empty
results in a blank email (the .TextBody is not received) and trying to
set .HTMLBody=Nothing or =Null results in an error.

I'm googling in the meantime, but not finding.  : (

Any help?

Tab


More information about the thelist mailing list