Results 1 to 3 of 3
  1. #1
    5 Star Lounger
    Join Date
    Mar 2001
    Posts
    989
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Standardized document (2002)

    I'm hoping someone will have a procedure that I can 'borrow'.. What I want to do is take a document that may have originated in Spain, Italy, etc., and translate numbers, and dates into UK format. In particular, to switch commas with periods in numbers. For example, 1.000 should be 1,000. Can anyone point me in the right direction? Thanks ,Andy.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Standardized document (2002)

    For numbers:

    - Select Edit | Replace...
    - Click More>>
    - Tick the check box "Use wildcards".
    - Enter <code>([0-9]),([0-9])</code> in the Find what box.
    - Enter <code>1xxxx2</code> in the Replace with box.
    - Click Replace All.
    - Enter <code>([0-9]).([0-9])</code> in the Find what box.
    - Enter <code>1,2</code> in the Replace with box.
    - Click Replace All.
    - Enter <code>([0-9])xxxx([0-9])</code> in the Find what box.
    - Enter <code>1.2</code> in the Replace with box.
    - Click Replace All.

    Note: xxxx is just a string that isn't likely to occur in the document. You can change it to something different if necessary.

    As a macro:
    <code>
    Sub ChangeNumbers()
    With ActiveDocument.Content.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .MatchWildcards = True
    .Execute FindText:="(<!t>[0-9]<!/t>),(<!t>[0-9]<!/t>)", ReplaceWith:="1xxxx2", Replace:=wdReplaceAll
    .Execute FindText:="(<!t>[0-9]<!/t>).(<!t>[0-9]<!/t>)", ReplaceWith:="1,2", Replace:=wdReplaceAll
    .Execute FindText:="(<!t>[0-9]<!/t>)xxxx(<!t>[0-9]<!/t>)", ReplaceWith:="1.2", Replace:=wdReplaceAll
    End With
    End Sub
    </code>
    Dates might be more difficult since there are so many ways of entering a date.

  3. #3
    5 Star Lounger
    Join Date
    Mar 2001
    Posts
    989
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Standardized document (2002)

    Thank you. Andy.

Posting Permissions

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