Results 1 to 6 of 6
  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
    Last edited by Ethen; 2014-12-28 at 03:00.

  2. #2
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,188
    Thanks
    47
    Thanked 983 Times in 913 Posts
    Some nice examples on this page.

    cheers, Paul

  3. #3
    New Lounger
    Join Date
    Dec 2014
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Paul T View Post
    Some nice examples on this page.

    cheers, Paul
    Dear Paul thanks for your reply but i didn't find anything might help at this page

  4. #4
    WS Lounge VIP
    Join Date
    Dec 2009
    Location
    Earth
    Posts
    8,188
    Thanks
    47
    Thanked 983 Times in 913 Posts
    My VB is a little rusty but I think this should be close.
    You only need to use "Selection" once as you've used "with", then you replace all. You will need to set _TextToFind to the character you are searching for and _ReplacementText to the replacement. You also need to loop through and change those values as required.

    Code:
    _TextToFind = "?"
    _ReplacementText = "?"
    With Selection.Find
      .Text = _TextToFind
      .Replacement.Text = _ReplacementText
      .Wrap = wdFindContinue
      .Execute Replace:=wdReplaceAll
    End With
    cheers, Paul

  5. #5
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  6. #6
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts
    This has been double-posted and answered here http://windowssecrets.com/forums/sho...s-macro-please
    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
  •