title: Convert a Word Range to a String with HTML tags in VBA
body: <p>I have a Word document and I need to copy some paragraph of it into a string in VBA. When doing so, the text formatting must be converted to HTML tags. For example if my paragraph looks like this:</p>
  
  <p>Hello I am <strong>Alice</strong>.</p>
  
  <p>I want to get a string that contains:</p>
  
  <pre><code>Hello I am &lt;b&gt;Alice&lt;/b&gt;
  </code></pre>
  
  <p>(And it would be great if it also work for bulleted list and other kind of formatting).</p>
  
  <p>I am using Microsoft Visual Basic for Applications 7.0.
  I am new to VBA and a lot of code I found on Internet does not work for me because my version is old. Unfortunately, downloading a more recent version is not an option in my case. </p>
  
  <p>Here is a code sample that works to convert a paragraph to a string without formatting:</p>
  
  <pre><code>Dim pParagraph As Paragraph
  '... at some point, pParagraph is set to a paragraph of the document
  
  Dim pRange As Range
  Dim pString As String
  Set pRange = ActiveDocument.Range(Start:=pParagraph.Range.Start, End:=pParagraph.Range.End - 1)
  pString = Trim(pRange.Text)
  </code></pre>
  
  <p>I did some research on Internet and found the advise to copy the Range to the clipboard and to use <code>Clipboard.getText</code>. Unfortunately <code>Clipboard.getText</code> does not even compile for me.</p>