Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Dec 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy help in change numbers macro,please

    Hi all,good morning

    please i need a help badly in a macro to replace all Arabic digits like "٠١٢٣٤٥٦٧٨٩" to English digits like "1234567890" i tried to replace them by unicode but i failed then i tried to give them LTR command run but my macro is missing something please help i have a lot of documents to work on
    Do While Selection.Find.Execute
    With Selection.Find
    Selection.Find.Replacement.ClearFormatting
    .Text = "[0,1,2,3,4,5,6,7,8,9]"
    .MatchWildcards = True
    End With
    iCount = 1000
    iCount = iCount + 1
    Application.Browser.Next
    WordBasic.LtrRun

    Selection.Find.Execute Replace:=wdReplaceAll

    Selection.HomeKey Unit:=wdStory
    Selection.Find.Execute

    Loop

    End Sub

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    I'm not sure on the exact number transposition but this might do it...
    Code:
    Sub ArabicBegone()
      Dim sglNum As Single
      
      With ActiveDocument.Range.Find
        .ClearFormatting
        .Replacement.ClearFormatting
        .MatchWildcards = False
        .Wrap = wdFindContinue
        For sglNum = 1631 To 1640
          .Text = ChrW(sglNum)
          .Replacement.Text = ChrW(sglNum - 1583)
          .Execute Replace:=wdReplaceAll
        Next sglNum
        .Text = ChrW(1641)
        .Replacement.Text = "0"
        .Execute Replace:=wdReplaceAll
      End With
    End Sub
    Last edited by Andrew Lockton; 2015-01-01 at 01:48.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •