title: How To Search and Replace Text in ActiveX TextBox
body: <p>I am trying to search an ActiveX TextBox (TextBox1) to replace a phrase with nothing...</p>
  
  <p>I have this code that seems to just wipe the entire box rather than the phrase in isolation.</p>
  
  <pre><code>Private Sub CommandButton3_Click()
  
  
  TextBox1 = Selection
  
  
  Selection.Find.ClearFormatting
      Selection.Find.Replacement.ClearFormatting
      With Selection.Find
          .Text = "This is the text to remove!"
          .Replacement.Text = ""
          .Forward = True
          .Wrap = wdFindContinue
          .Format = False
          .MatchCase = False
          .MatchWholeWord = False
          .MatchWildcards = False
          .MatchSoundsLike = False
          .MatchAllWordForms = False
      End With
      Selection.Find.Execute Replace:=wdReplaceAll
  
  
  End Sub
  </code></pre>
  
  <p>With some additions (like selecting all shapes in the active document)- the code works with an ordinary TextBox - and with the rest of the document too... just not the ActiveX box (which is what I want!!)</p>
  
  <p>Please help!</p>