• Controlling editor type from VBA (2000)

    Home » Forums » AskWoody support » Productivity software by function » MS Outlook and email programs » Controlling editor type from VBA (2000)

    • This topic has 2 replies, 2 voices, and was last updated 21 years ago.
    Author
    Topic
    #405410

    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. puke

    Thanks for your help thankyou
    Peter

    Viewing 1 reply thread
    Author
    Replies
    Viewing 1 reply thread
    Reply To: Controlling editor type from VBA (2000)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: