title: Changing text in a paragraph using vba word
body: <p>I am trying to change text in a paragraph using vba word. The following code causes the Next to not go to the next element in the collection.</p>
  
  <pre><code> Sub ReadPara()
   Dim myString$
   Dim DocPara As Paragraph
  
   For Each DocPara In ActiveDocument.Paragraphs
     'Debug.Print DocPara.Range.ParagraphStyle '; " - "; DocPara.Range.Text
     If Left(DocPara.Range.ParagraphStyle, Len("Heading")) = "Heading" Then
       Debug.Print DocPara.Range.ListFormat.ListString
     End If
    'This section does not go to the next element in the collection
    If InStr(DocPara.Range.Text, "HW") &gt; 1 Then
      Debug.Print DocPar; qa.Range.Text
      myString$ = DocPara.Range.Text
      DocPara.Range.Text = myString$ &amp; "Changed"
     '  Debug.Print DocPara.Range.Text
    End If
   Next DocPara
   End Sub
  </code></pre>