title: Replace text in HTML body
body: <p>I'm trying to replace text in the body of a template already created in Outlook 2010.  The purpose of this is so that users can update the contact which the email is being sent to fairly easily.</p>
  
  <pre><code>Sub NewUserEmail()
  
  Dim myItem As Outlook.MailItem
  Dim strContact As String
  Dim strCompanyName As String
  Dim strHTML As String
  
  Set myItem = Application.CreateItemFromTemplate( _
        "C:\Users\jim.reagan\AppData\Roaming\Microsoft\Templates\NewUserEmail.oft")
      strHTML = myItem.HTMLBody
      strContact = InputBox("What is the Contact's name?")
      myItem.HTMLBody = Replace(myItem.HTMLBody, "%&lt;Contact&gt;%", strContact)
  
  myItem.Display
  End Sub
  </code></pre>
  
  <p>The template opens up for review but no replacements have been made to the body of the email.  If I use myItem.Body the replacement works but then I lose my formatting of my email.  What am I missing?</p>