Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create new text mail in Outlook.

Status
Not open for further replies.

Kraeg

Programmer
Jun 27, 2002
113
AU
When creating an e-mail message from VB, is it possible to over-ride the HTML/Text/RTF default format settings for messages using a line of code (perhaps a propery or method)?
Here's my basic current code:

Dim olApp As Outlook.Application
Set olApp = CreateObject("Outlook.Application")

Dim olNs As Outlook.NameSpace
Set olNs = olApp.GetNamespace("MAPI")
olNs.Logon

Dim olMail As Outlook.MailItem
Set olMail = olApp.CreateItem(olMailItem)

olMail.To = "name@server.au"
olMail.Subject = "Test"
olMail.Body = "Testing..."
olMail.Display
 
The mail format is available through the EditorType property of the Inspector displaying the mail item; unfortunately it's read-only at run-time.

When the mail item is created it will be in the format defined in Tools | Options | Message Format. It can't be changed except in one situation. If you set the item's HTMLBody property to a HTML formatted string, the Inspector's EditorType is automatically changed to olEditorHTML.

Paul Bent
Northwind IT Systems
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top