Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Edit field in Word mail merge recipient list

Status
Not open for further replies.

KeyserSoze

Programmer
May 18, 2000
79
US
Hi:

I have a letter document and a data source that I am doing a mail merge. The one thing that I would like to do before I create a new document with all of the data from the data source filled in is to change a particular character (0) in the data of one of the fields of all of the records to another character (Ø). I'm doing this to differentiate the letter O from the number 0.

Is this possible? I'm using Word 2003.

Thanks!
 
If I understand this correctly, you are asking about changing the datasource before the merge. Then the datasource would have to be changed. This would not be a Word function.

Gerry
My paintings and sculpture
 



Hi,

In Word, you could choose a character set that has the type of zero that you desire. No need to change the source data.

Skip,

[glasses] [red][/red]
[tongue]
 
Hi KeyserSoze,

If want to change merges returning 0s only (i.e not 10 or 100, for example), then the following change to the field coding in your main mailmerge document will do the trick:
{MAILMERGE MyData \# 0;0;Ø} To get the Ø, use Alt-0216.

Cheers

[MS MVP - Word]
 
Macroprod:

I presently have an IF statement set up for my field:

{IF {MERGEFIELD ID_NUM = ""} "{MERGEFIELD ID_NUM2}" "{MERGEFIELD ID_NUM}"}

Whatever the result, I want to replace 0 with Ø. How can I incorporate your solution with the above IF statement?

Thanks!
 
Hi KeyserSoze,

Q: "How can I incorporate your solution with the above IF statement?"

A: You don't. Unless ID_NUM2 has a non-zero value that you want to output, the field code I posted is all you need:
{MAILMERGE MyData \# 0;0;Ø}
If ID_NUM2 is some other non-zero value, then the correct syntax for your field coding is:
{IF{MERGEFIELD ID_NUM}= "" {MERGEFIELD ID_NUM2} {MERGEFIELD ID_NUM}}
or
{IF{MERGEFIELD ID_NUM}= 0 {MERGEFIELD ID_NUM2} {MERGEFIELD ID_NUM}}
depending on whether {MERGEFIELD ID_NUM} returns blanks or 0s.

Cheers

[MS MVP - Word]
 
MacroProd:

ID_NUM and ID_NUM2 could be values such as "9TD01" or "80448". In these cases, I want to change them to "9TDØ1" and "8Ø448" respectively.

My apologies for not being clear.

Thanks!
 
Hi KeyserSoze,

In that case, you need to use the IF test, as in:
{IF{MERGEFIELD ID_NUM}= "" {MERGEFIELD ID_NUM2} {MERGEFIELD ID_NUM}}
or
{IF{MERGEFIELD ID_NUM}= 0 {MERGEFIELD ID_NUM2} {MERGEFIELD ID_NUM}}
depending on whether {MERGEFIELD ID_NUM} returns blanks or 0s when there are no valid data. Plus you'll need to change the 0s to Øs in your data source - there's no practical way to code around this with field coding.

Cheers

[MS MVP - Word]
 
MacProd:

Thanks for your help on this. I kind of figured that the best way to handle it was to change the data source.

..... Keyser
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top