Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
foxcole foxcole is offline
external usenet poster
 
Posts: 10
Default URGENT:Is it possible to replace data character with another chara

(Apologies if this is a common question. I've looked all through the Help
file, knowledge base and discussion groups and haven't found the right
combination of words to find anything useful... even if it's to say that what
I want isn't possible.)

In the data source, telephone numbers are in text format separated by dots
(for example, 555.123.4567). The requester wants to replace the dots with
hyphens in the merged letter, but I can't see a way to do this. This is the
first merge I've tried with Word 2003, and I do mail merges very rarely
anyway, so what perhaps should be obvious, isn't. I would be very grateful
for any help, but I also need to send the letter out this afternoon, so it is
rather urgent.

Cheers!
---Fox Cole
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default URGENT:Is it possible to replace data character with another chara

If the phone numbers have a completely consistent format, the simplest thing
to do is probably to
a. output the merge to a new document
b. use WOrd Find/Replace, switch on the Use Wildcards option, and replace

([0-9]{3}).([0-9]{3}).([0-9]{4})

by

\1-\2-\3

To explain in case you need to change things a bit,

[0-9] makes Word look for character "0" to character "9"
{3} makes Word look for 3 of them
([0-9]{3}) makes Word treat those 3 characters as an "expression" that you
can reference using a number in the replacement text. The first expression
is numbered 1, so
\1 says "use the text you found in expression 1" in the result.

If the data source can be opened in Word you could consider making the
replacement there instead.

The alternative is really to open the data source using VBA and a piece of
SQL that does the replacement, but that is IMO harder and is only possible
if there are 255 columns or fewer in the data source.

If you have other numbers formatted nnn.nnn.nnnn that you want to keep that
way. then you would need to distinguish them in some way. but let's not go
there unless we have to.

Peter Jamieson
"foxcole" wrote in message
...
(Apologies if this is a common question. I've looked all through the Help
file, knowledge base and discussion groups and haven't found the right
combination of words to find anything useful... even if it's to say that
what
I want isn't possible.)

In the data source, telephone numbers are in text format separated by dots
(for example, 555.123.4567). The requester wants to replace the dots with
hyphens in the merged letter, but I can't see a way to do this. This is
the
first merge I've tried with Word 2003, and I do mail merges very rarely
anyway, so what perhaps should be obvious, isn't. I would be very grateful
for any help, but I also need to send the letter out this afternoon, so it
is
rather urgent.

Cheers!
---Fox Cole


  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
foxcole foxcole is offline
external usenet poster
 
Posts: 10
Default URGENT:Is it possible to replace data character with another c

"Peter Jamieson" wrote:

If the phone numbers have a completely consistent format, the simplest thing
to do is probably to
a. output the merge to a new document
b. use WOrd Find/Replace, switch on the Use Wildcards option, and replace

([0-9]{3}).([0-9]{3}).([0-9]{4})


I was hoping for a way to code it into the merge field, but this solution
works just fine too. Thank you, Peter, for the quick reply!

Cheers!
---Fox
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
Find/Replace specific character michaelberrier Microsoft Word Help 3 January 24th 07 07:26 AM
Pressing ALT+FN+character code doesn't produce international chara tony Microsoft Word Help 1 November 6th 05 12:49 AM
Data source link urgent question! Mark Mailmerge 1 April 7th 05 09:05 AM
replace @ character in word Howzitgoing Microsoft Word Help 4 January 21st 05 10:14 PM
Designating "Any Character" in Replace Dialog Joseph N. Microsoft Word Help 3 December 7th 04 05:36 AM


All times are GMT +1. The time now is 11:02 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"