title: How to Delete Text in Word Using Active X Controls
body: <p>I am currently attempting to create an automated letter on word and know essentially nothing about activex or vba.</p>
  <p>I want to create a checkbox that will show text (a subsection of text) only if it is selected. I had originally used a code like this to hide or show text.</p>
  <pre><code>Private Sub CheckBox1_Click()
  If CheckBox1.Value = True Then
      ActiveDocument.Bookmarks(&quot;TextToHide&quot;).Range.Font.Hidden = False
  Else
      ActiveDocument.Bookmarks(&quot;TextToHide&quot;).Range.Font.Hidden = True
  End If
  End Sub
  </code></pre>
  <p>However, since my letter had numbered bullets, depending on which checkbox was selected the order of the letter is completely messed up.
  Example: I do not want subsections 1,3,5,6 included in the letter (and it is not) but the bullet's order look like this</p>
  <ol start="2">
  <li>Subsection...</li>
  <li>Subsection...</li>
  <li>Subsection...</li>
  </ol>
  <p>I figured the only way to get around this is to completely delete the subsection so that the Bullet numbers are in the correct order. I attempted to write the following code but it will not delete the subsection/bookmarked text.</p>
  <pre><code>Sub DeleteBookmark()
      If CheckBox1.Value = False Then
       ActiveDocument.Bookmarks(&quot;TextToHide&quot;).Delete
      End If
  End Sub
  </code></pre>
  <p>Could anyone please help me delete the bookmarked text or update the bullet's numbers when hiding a subsection of the letter?</p>