Define Outlook Application

  • Use below mentioned code to define Outlook Application
  • Dim OLApp As Outlook.Application
    Set OLApp = New Outlook.Application

    Define MailItem

    Dim OMail As Outlook.MailItem
    Set OMail = OLApp.CreateItem(olMailItem)

    Define MailItem Properties

    With OMail
    .To = "Enter Your Mail ID"
    .CC = "Enter Your Mail ID"
    .BCC = "Enter Your Mail ID"
    .Subject = "Hello How are you?"
    .BodyFormat = olFormatPlain
    .Body = "Hi" & vbNewLine & _ vbNewLine & _ "First Line" & vbNewLine & _
    "second Line" & vbNewLine & _
    "Third Line" & vbNewLine
    .Importance = olImportanceHigh
    .Display
    .Send
    End With

    OutlOok Body format Classification