title: How to save formatted MS Outlook email body with HTML elements into MS Access table?
body: <p>I tried this simple code:    </p>
  
  <pre><code>Sub sendOutlookEmail()
  Dim oApp As Outlook.Application
  Dim oMail As MailItem
  Set oApp = CreateObject("Outlook.application")
  
  Set oMail = oApp.ActiveExplorer.Selection.Item(1)
  
  Dim HTMLBody As String
  HTMLBody = oMail.HTMLBody
  
  HTMLBody = Replace(HTMLBody, Chr(34), Chr(34) &amp; Chr(34), 1)
  
  Dim sql As String
  sql = "UPDATE email_body set email_body = " &amp; Chr(34) &amp; HTMLBody &amp; Chr(34)
  
  Debug.Print sql
  CurrentDb.Execute sql
  
  Set oMail = Nothing
  Set oApp = Nothing
  
  End Sub
  </code></pre>
  
  <p>This simple code saves the body of the email to my MS Access table with all HTML elements. Later on, I want to run this code:</p>
  
  <pre><code>Sub sendOutlookEmail()
  Dim oApp As Outlook.Application
  Dim oMail As MailItem
  Set oApp = CreateObject("Outlook.application")
  
  Set oMail = oApp.CreateItem(olMailItem)
  
  Dim sql As String
  sql = "Select email_body from email_body"
  
  Dim rs As DAO.Recordset
  Set rs = CurrentDb.OpenRecordset(sql)
  
  oMail.Body = rs("email_body")
  oMail.Subject = "email sent from ms access using vba 2"
  oMail.To = "receiver@somthing.com"
  
  oMail.Display
  
  Set oMail = Nothing
  Set oApp = Nothing
  
  End Sub
  </code></pre>
  
  <p>That code should take whatever was stored in my MS Access table and create a new email. What it does though, it copies the literal HTML code into the body of the email which is obviously not what I want. Is there a way to get it displayed the proper way?</p>