title: Inserting text with formatting in invitation body
body: <p>I am trying to automate Outlook invites. The code is working until I arrive to the body. I need something more elaborate than just plaintext. I can't find the .HTMLBody property/the compiler doesn't recognize it: Run-time Error '438'.</p>
  
  <p>Is there any other way of inserting text with format in my invite body?</p>
  
  <p>The code works when using .body:</p>
  
  <pre><code>Sub Invite_Merge(meeting_date As Date, meeting_time As Double,         
          meeting_duration As Integer, client_email As String, meeting_subject As String,
          meeting_location As String, client_name As String, meeting_body As String,
          meeting_sender As String)
  
  
      Dim O As Outlook.Application
      Set O = New Outlook.Application
  
      Dim OAPT As Outlook.AppointmentItem
      Set OAPT = O.CreateItem(olAppointmentItem)
      OAPT.MeetingStatus = olMeeting
  
      Dim meeting_start
      meeting_start = DateValue(meeting_date) + meeting_time
  
      With OAPT
  
          .Recipients.Add (client_email)
          .Subject = meeting_subject
          .Start = meeting_start
          .Duration = meeting_duration
          .Location = meeting_location
          .HTMLBody = "&lt;HTML&gt;&lt;BODY&gt;Enter the message text here. &lt;/BODY&gt;&lt;/HTML&gt;"
          .Display
          '.Send
  
      End With
  
  End Sub
  
  
  Sub Send_Invites()
  
      row_number = 2
  
      Do
      DoEvents
  
      row_number = row_number + 1
      If IsEmpty(Sheet1.Range("D" &amp; row_number)) = False Then
  
          Call Invite_Merge(Sheet1.Range("A" &amp; row_number), Sheet1.Range("B" &amp; row_number), Sheet1.Range("C" &amp; row_number), Sheet1.Range("D" &amp; row_number), Sheet1.Range("E" &amp; row_number), Sheet1.Range("F" &amp; row_number), Sheet1.Range("G" &amp; row_number), Sheet1.Range("H" &amp; row_number), Sheet1.Range("A" &amp; "1"))
  
      End If
      Loop Until row_number = 100
  
  End Sub
  </code></pre>