title: Compare text if shorter
body: <p>I am doing comparmision between excel strings and word strings (within paragraphs), after delete all special characters froom excel strings and word strings i am doing compare. Unformtunetly looping through word paragrapphs and looking for specific match string excel has full string to be found but word sometimes not e.g:</p>
  
  <p>excel string to be found: </p>
  
  <pre><code>Kodpocztowyimiejscowo34331winna
  </code></pre>
  
  <p>search paragraph for instance: </p>
  
  <pre><code>Ulicaulywiecka29Kodpocztowyimiejscowo34331winn ' missing 'a' in the end ...
  </code></pre>
  
  <p>My compare code here not working in such cases this line:</p>
  
  <blockquote>
    <p>If InStr(txt, search) Then</p>
  </blockquote>
  
  <p>Unformtunetly sometimes word can cut some letters, do you know how i can update my code to be secure on that cases? See my whole code i got:</p>
  
  <pre><code> Do
           ExcelField = ""
           X = X + 1
           ExcelField = EWS.Cells(RowNr, X)
  
           If ExcelField &lt;&gt; "" Then
  
           ExcelField = RemoveSpecialChars(ExcelField)
  
               If ExcelField = "KONIEC" Then Exit Do
  
   Dim search As String
       search = ExcelField
  
       Dim para As Paragraph
  
       For Each para In WordDoc.Paragraphs
  
           Dim txt As String
           txt = para.Range.Text  'whole word paragraphs
           txt = RemoveSpecialChars(txt) ' whole paragraph withhout special characters
  
           If txt &lt;&gt; "" Then    'sometimes in Excel columns are nulls we go next
           If InStr(txt, search) Then       
  
               EWS.Cells(5, X).Interior.ColorIndex = 4  'green marked
               Exit For 'field found in word exit and next
           Else
               EWS.Cells(5, X).Interior.ColorIndex = 3  'red marked '                                Exit For 'field found in word exit and next
  
           End If
           End If
  
       Next
  
           End If
  
       Loop Until EWS.Cells(RowNr, X) = "KONIEC"
  </code></pre>