Send email in plain text format in vbscript

L

Long Nguyen

Good day,

I have a vbscript code in my custom Outlook form that sends out an email,
similar to the code below. How can I code so that the email is sent in PLAIN
TEXT format (instead of whatever format - html/plain text/rich text - set in
the form user's Outlook environment).

Thanks
Long

Set NewMail = Item.Application.CreateItem(olMailItem)
NewMail.Subject = "My subject"
NewMail.Body = "My body"
NewMail.Recipients.Add(Item.To)
NewMail.Send
Set NewMail = Nothing
 
L

Long Nguyen

I am using Outlook 2000 SR-1.
Some form users use this version, some use Outlook XP (which I am not sure
the exact version number).
Thanks.
 
S

Sue Mosher [MVP-Outlook]

To generate a message in plain text format in Outlook 2000, you'll have to
create the message with CDO 1.21 (Collaboration Data Objects), rather than
Outlook objects. Outlook 2000 has no way to create a plain text message
programmatically. See http://www.outlookcode.com/d/cdo.htm for information
to help you get started with CDO.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
L

Long Nguyen

Thansk Sue.

I have just got a new PC with Outlook 2002 SP2. The PC runs Windows XP.

Does Outlook 2002 SP2 allow creating message in plain text format? If so
could you point to me where to look for more information. If I do that under
2002 SP2, would that be ok for form users who are still using Outlook 2000
SR-1?

Thanks
Long
 
S

Sue Mosher [MVP-Outlook]

Yes, just set the BodyFormat to olFormatPlain after you create the message.
That, of course, will not work for OL2000 users.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

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