title: VBA Macro to search a text string and replace with hyperlink works only with English text, but not Arabic
body: <p>I have Arabic texts in Microsoft Word that I need to introduce hpyerlinks to some of its words. </p>
  
  <p><a href="https://superuser.com/a/1010293/722191">The reply to this question here works</a> for me, but only for English words. When I replace the word "google" with any Arabic string (Whether one word or multiple words), the macro does not work.</p>
  
  <p>I can display the Arabic characters correctly in VBA, <a href="https://stackoverflow.com/a/32485700/6227615">using the answer to this question here</a>, so there are no problems displaying the text in the macro.</p>
  
  <p>Can you please help me understanding what code modifications I need to have, in order to get the macro to recognize the arabic text?</p>
  
  <p>Needless to say, the Arabic language is a UTF-8 regulated language.</p>
  
  <p>Here is an Arabic word to test on:</p>
  
  <p>كلمة</p>
  
  <p>and here is the macro I am using, based on the link I provided above:</p>
  
  <pre><code>Sub FindAndHyperlink()
      'define the style
      Dim strStyle As String
      strStyle = "Subtle Emphasis"
      'set the search range
      Dim rngSearch As Range
      Set rngSearch = ActiveDocument.Range
      'set the search string
      Dim strSearch As String
      strSearch = "google"
      'set the target address for the hyperlink
      Dim strAddress As String
      strAddress = "http:\\google.com"
  
      With rngSearch.Find
          Do While .Execute(findText:=strSearch, MatchWholeWord:=True, Forward:=True) = True
              With rngSearch 'we will work with what is found as it will be the selection
                  ActiveDocument.Hyperlinks.Add Anchor:=rngSearch, Address:=strAddress
                  .Style = ActiveDocument.Styles(strStyle) 'throw the style on it after the link
              End With
              rngSearch.Collapse Direction:=wdCollapseEnd
              'keep it moving
          Loop
      End With
  End Sub
  </code></pre>
  
  <p>Thanks in advance.</p>
  
  <p>Here is a screenshot of the outcome, after running the macro on a 3-word English phrase (worked), then changing it to one Arabic word (did not work).</p>
  
  <p><a href="https://i.stack.imgur.com/zs7c7.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zs7c7.jpg" alt="Macro results"></a></p>
  
  <p><strong>EDIT 01</strong></p>
  
  <p>I modified my macro, based on @Cindy_Meister's answer below, but tried to group the characters in a list. The results are that the macro works, but on the decimal numbers, not the Arabic characters.</p>
  
  <p>so, to add links to the phrase <code>الأنبا غريغوريوس</code>:</p>
  
  <p>Here is the updated macro:</p>
  
  <pre><code>Sub FindAndHyperlink2()
  '
  ' FindAndHyperlink2 Macro
  '
  '
  'define the style
      Dim strStyle As String
      strStyle = "Subtle Emphasis"
      'set the search range
      Dim rngSearch As Range
      Set rngSearch = ActiveDocument.Range
      'set the search string
      Dim strSearch_list As String
      strSearch_list = "01575&amp;01604&amp;01571&amp;01606&amp;01576&amp;01575&amp;00032&amp;01594&amp;01585&amp;01610&amp;01594&amp;01608&amp;01585&amp;01610&amp;01608&amp;01587"
      Dim strSearch As Variant
      strSearch = Split(strSearch_list, "&amp;")
  
      For i = 0 To UBound(strSearch)
      With rngSearch.Find
      .Text = ChrW("&amp;H" &amp; Val(strSearch(i)))
  
  
      'set the target address for the hyperlink
      Dim strAddress As String
      strAddress = "http:\\google.com"
  
  
          Do While .Execute(findText:=strSearch_list, MatchWholeWord:=True, Forward:=True) = True
              With rngSearch 'we will work with what is found as it will be the selection
                  ActiveDocument.Hyperlinks.Add Anchor:=rngSearch, Address:=strAddress
              End With
              rngSearch.Collapse Direction:=wdCollapseEnd
              'keep it moving
          Loop
      End With
  
      Selection.Find.Execute Replace:=wdReplaceAll
  
  Next i
  
  End Sub
  </code></pre>
  
  <p>but when I apply this macro on an MS Word file that has both the decimal block and the Arabic text,  find that the decimal block is the one that was converted to a link, like the screenshots below:</p>
  
  <p>Screenshot <strong>before</strong> applying the macro:</p>
  
  <p><a href="https://i.stack.imgur.com/h2P4a.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/h2P4a.png" alt="Before applying the macro"></a></p>
  
  <p>Screenshot <strong>after</strong> applying the macro:</p>
  
  <p><a href="https://i.stack.imgur.com/MslAx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MslAx.png" alt="After applying the macro"></a></p>
  
  <p><strong>What I want to achieve:</strong>
  <a href="https://i.stack.imgur.com/qOBOe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qOBOe.png" alt="What I want to achieve"></a></p>