title: Finding a Word in a textbox using vba
body: <p>Hello I am trying to do a search for a word in a text box. Once that word is found I want the system to find the next 7 words following the found word. Basically, each time a paragarph will be copied in this textbox and there is one word (User ID:) will always be there. But a different user id will be entered following the word "User ID:" every time. I would like to automate this to the system to find out. I am able to find the word "User ID" with the code below. But I am not sure how get the actual user id that follows it. </p>
  
  <pre><code>Dim Search, Where
  ' Get search string from user.
  Search = "User ID:"
  ' Find string in text.
  Where = InStr(TxtWebForm.Text, Search)
  If Where Then
      TxtWebForm.SetFocus
      TxtWebForm.SelStart = Where - 1
      TxtWebForm.SelLength = Len(Search)
  Else
      MsgBox "String not found."
  End If
  </code></pre>