title: Delete text contained by bookmarks that are hidden
body: <p>I created a template in which, based on the values of the specific checkboxes (content controls), paragraphs that are selected with bookmarks having the same name as the checkboxes are hidden using the following formula</p>
  
  <pre><code>Dim bookmark As String
  Dim ctl As ContentControl
  For Each ctl In ActiveDocument.ContentControls
      If ctl.Type = wdContentControlCheckBox Then
          If ctl.Checked = False Then
              bookmark = ctl.Tag
              Bookmarks(bookmark).Range.Font.Hidden = True
          Else
              bookmark = "hide_" &amp; ctl.Tag
              Bookmarks(bookmark).Range.Font.Hidden = True
          End If
      End If
  Next
  </code></pre>
  
  <p>I am trying to strip the document of the paragraphs that are using the above mentioned formula (delete them).<br>
  I am trying to strip the document of the hidden paragraphs because I want to number the paragraphs and, without deleting them, the numbering refers to the hidden ones.</p>
  
  <p>Using find and replace with hidden font doesn't help because it's a different type of hidden content. I think the bookmarks are saved in xml code.</p>