title: Looping through Word document to format text
body: <p>I have a huge document in which the lines starting with some specific words text style should be changed. I have created an array for all those words and tried formatting the document using For loop. But only the style of first word in the array is getting changed not for all the words in the array.</p>
  
  <p>Below is what I did, please have a look at it and suggest the solution:</p>
  
  <pre><code>Sub Variables_NormalTxt()
      Dim oRng As Word.Range
      Dim oRngFC As Word.Range
      Dim varUbyteNormal As Variant
      Dim ArrayItem As String
      Dim i As Integer
      varUbyteNormal = Array("uword", "ubyte", "bool", "sword", "const", "ulong", "static")
      Set oRng = ActiveDocument.Range
      i = 0
      For i = 0 To UBound(varUbyteNormal)
      With oRng.Find
          .Text = varUbyteNormal(i)
          .Font.Name = "Times New Roman"
          .Font.Bold = False
          .Font.size = 10
          While .Execute
            oRng.Select
            Set oRngFC = ActiveDocument.Bookmarks("\Line").Range
                oRngFC.Style = "variable normal"
              Wend
          End With
      Next i
  End Sub
  </code></pre>