Canada Postal Codes

  • Thread starter David BallQuenneville
  • Start date
D

David BallQuenneville

I am merging to a word document using MS Query from a 3rd party application
whose data is in MS SQL 2000.



With in their database is setup as a Zip Code not Canadian Postal Codes
(123456 instead of M1N 2B7.) Therefore the code comes out as all 6
characters together not 3 space 3. Is there a way to format the merge field
as I can change the vendors format?



Thanks

David
 
D

David BallQuenneville

Ooops I screwed up I mean to say "Is there a way to format the merge field
as I can't change the vendors format?
 
D

Doug Robbins - Word MVP

Hi David,

If Canadian Postal Codes are always of the format character number character
number character number, then you could use a Wildcard Edit Replace routine
on the documnet created by the mail merge with

([A-Z]{1}[0-9]{1}[A-Z]{1})([0-9]{1}[A-Z]{1}[0-9]{1})

in the "Find what:" control and

\1 \2\

in the "Replace with:" control to insert the space. (Note there is a space
between the 1 and the \)

For an explanation, see the article “Finding and replacing characters using
wildcards” at:

http://word.mvps.org/FAQs/General/UsingWildcards.htm


--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top