title: WordEditor Insert HTML from string
body: <p>Working on a word document to which I need to add some text in HTML. I am able to load HTML form a file using the below code:</p>
  
  <pre><code>Microsoft.Office.Interop.Word.Document doc = new Microsoft.Office.Interop.Word.Document();
  // Loading of Content
  // ...
  Range wdRange = doc.Range(0, doc.Characters.Count);
  wdRange.InsertFile(FileName: @"C:\temp\MyTextInHtml.html", Attachment: false);
  </code></pre>
  
  <p>The issue is that my HTML content is in a string and not in a file:</p>
  
  <pre><code>string htmlContent = "&lt;html&gt;&lt;body&gt;&lt;h1&gt;Hello world!&lt;/h1&gt;&lt;/body&gt;&lt;/html&gt;";
  wdRange.InsertAfter(htmlDoc);
  </code></pre>
  
  <p>The HTML is understood as text and not interpreted.
  I have tried/considered using the Range.PasteSpecial() but did not succeed using the below code:</p>
  
  <pre><code>// Load the html into the clipboard
  Clipboard.SetText(bkmContent);
  
  // Attempt to insert at the end of the document
  Range wdRange = doc.Range(doc.Characters.Count-1, doc.Characters.Count);
  wdRange.PasteSpecial(WdPasteDataType.wdPasteHTML);
  
  // Attempt to create a bookmark around the inserted text
  doc.Bookmarks.Add("HTMLInsert", wdRange);
  </code></pre>
  
  <p>As a result the HTML is still not interpreted and I see the html instructions and the bookmark does not include the text.</p>