Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.docmanagement
Von Stussi Von Stussi is offline
external usenet poster
 
Posts: 5
Default search-replace: Formatting phone numbers imported from outlook

Hi,

When I create a directory in word 2003 and import phone numbers from Oulook
they appear like that (I live in Japan)

+nn (nn) nnnnnnnn

I would like separate the country code/area code like that:

+nn-nn-

and then separate only the 4 first digits of the phone numbers with a "-"
like that:

nnnn-(followed by the second part of the number of 3 or 4 digits depending
of the area)

As a variante, when working with European phone number, I would like to
groups all the digit by 2 separated with a "-" like that:

nn-nn-nn-nn

What is the string I have to write in the "Find what" and "Replace with"
using wildcards for these 3 questions? Could you show me the strings
separately and if possible with a word of explanation. I would like to
understand the pattern.

When I try do do it by myslef, the country code/area code/end of the number
got all messed-up with with hyphens at the wrong place and incorrect groups
of digit.

Thanks
  #2   Report Post  
Posted to microsoft.public.word.docmanagement
Doug Robbins - Word MVP Doug Robbins - Word MVP is offline
external usenet poster
 
Posts: 8,832
Default search-replace: Formatting phone numbers imported from outlook

For Find what, use:

(+[0-9]{1,}) \(([0-9]{1,})\) ([0-9]{4})([0-9]{3,})

and for the Replace

\1-\2-\3-\4

For the explanation, see the article "Finding and replacing characters using
wildcards" at:

http://www.word.mvps.org/FAQs/Genera...gWildcards.htm


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Von Stussi" wrote in message
...
Hi,

When I create a directory in word 2003 and import phone numbers from
Oulook
they appear like that (I live in Japan)

+nn (nn) nnnnnnnn

I would like separate the country code/area code like that:

+nn-nn-

and then separate only the 4 first digits of the phone numbers with a "-"
like that:

nnnn-(followed by the second part of the number of 3 or 4 digits depending
of the area)

As a variante, when working with European phone number, I would like to
groups all the digit by 2 separated with a "-" like that:

nn-nn-nn-nn

What is the string I have to write in the "Find what" and "Replace with"
using wildcards for these 3 questions? Could you show me the strings
separately and if possible with a word of explanation. I would like to
understand the pattern.

When I try do do it by myslef, the country code/area code/end of the
number
got all messed-up with with hyphens at the wrong place and incorrect
groups
of digit.

Thanks



  #3   Report Post  
Posted to microsoft.public.word.docmanagement
MT MT is offline
external usenet poster
 
Posts: 3
Default search-replace: Formatting phone numbers imported from outlook

Hi Doug,
That's just what I was looking for.
Thanks & thanks for the link.

"Doug Robbins - Word MVP" wrote:

For Find what, use:

(+[0-9]{1,}) \(([0-9]{1,})\) ([0-9]{4})([0-9]{3,})

and for the Replace

\1-\2-\3-\4

For the explanation, see the article "Finding and replacing characters using
wildcards" at:

http://www.word.mvps.org/FAQs/Genera...gWildcards.htm


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP

"Von Stussi" wrote in message
...
Hi,

When I create a directory in word 2003 and import phone numbers from
Oulook
they appear like that (I live in Japan)

+nn (nn) nnnnnnnn

I would like separate the country code/area code like that:

+nn-nn-

and then separate only the 4 first digits of the phone numbers with a "-"
like that:

nnnn-(followed by the second part of the number of 3 or 4 digits depending
of the area)

As a variante, when working with European phone number, I would like to
groups all the digit by 2 separated with a "-" like that:

nn-nn-nn-nn

What is the string I have to write in the "Find what" and "Replace with"
using wildcards for these 3 questions? Could you show me the strings
separately and if possible with a word of explanation. I would like to
understand the pattern.

When I try do do it by myslef, the country code/area code/end of the
number
got all messed-up with with hyphens at the wrong place and incorrect
groups
of digit.

Thanks




Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with Formatting Phone Numbers in Word 2003 AmandaH Microsoft Word Help 2 July 19th 06 01:48 PM
Formatting of text problem - Help needed with Style Sheets & Search and Replace Centurion Formatting Long Documents 1 August 8th 05 10:32 PM
Formatting of text problem - Help needed with Style Sheets & Search and Replace Centurion New Users 1 August 8th 05 10:32 PM
Formatting of text problem - Help needed with Style Sheets & Search and Replace Centurion Page Layout 1 August 8th 05 10:32 PM
Why can't I see 'home phone' field when mail merging from Outlook. Roger Mailmerge 1 December 19th 04 10:36 AM


All times are GMT +1. The time now is 11:09 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"