title: Outlook MailItem runtime error 287 on replacing text in message body
body: <p>I am creating an Outlook 2010 message from a template (oft file) and replacing part of the text within the Subject, Body and To properties.</p>
  
  <p>When I read Body and To a runtime error 287 is raised.</p>
  
  <pre><code>Sub test()
      Dim olApp As Outlook.Application
      Dim olItem As Outlook.MailItem
      Set olApp = CreateObject("Outlook.Application")
      Set olItem = olApp.CreateItemFromTemplate("C:\Users\Public\JobsTracker.V01\Templates\Template-1.oft")
      olItem.Subject = Replace(olItem.Subject, "sometext", "othertext") 'This works
      olItem.Body = Replace(olItem.Body, "sometext", "othertext")       'This raises Runtime Error 287
      olItem.Display
  End Sub
  </code></pre>