I’m creating emails programmatically from VBA (actually from Access).
I want the emails to be plain text, so I use code like this:
Dim oOutl As Outlook.Application Dim oNS As Outlook.NameSpace Dim oMail As Outlook.MailItem Set oOutl = New Outlook.Application Set oNS = oOutl.GetNamespace("MAPI") oNS.Logon "MS Exchange Settings", , False Set oMail = oOutl.CreateItem(olMailItem) With oMail .Subject = strSubject .Recipients.Add(strEmailAddr) .Body = strBody .Send End With
Problem is, this makes the message in the default editor for Outlook. Sometimes it’s Plain text, sometimes Rich text. The editor can be discovered with item.GetInspector.EditorType
But how do I change the editor that’s creating the message?
It can be done interactively with the message’s menu Format, Plain Text.
But I don’t want to use send keys.
Thanks for your help
Peter