Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
P. Anderson P. Anderson is offline
external usenet poster
 
Posts: 3
Default Substitute a word/character in the mergefield result

I would like to be able to substitue any comma from a {Mergefield field}
result to a return character. Then the Mergefield result "box, top,
carrot, onion" would look like

box
top
carrot
onion

Thank you
P. Anderson

  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
P. Anderson P. Anderson is offline
external usenet poster
 
Posts: 3
Default Substitute a word/character in the mergefield result

An additional note to the question, I am using Word 2007 to merge in
document information from ODBC datasource.

"P. Anderson" wrote:

I would like to be able to substitue any comma from a {Mergefield field}
result to a return character. Then the Mergefield result "box, top,
carrot, onion" would look like

box
top
carrot
onion

Thank you
P. Anderson

  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Substitute a word/character in the mergefield result

1. Ideally, make the substitution in your data source (what is it, and
which version of Word are you using? I ask because it is just possible
that you could issuse SQL that would do the appropriate REPLACE, but if
for example you data source uses the Jet engine (e.g. is Access or
Excel) that won't work.

2. If
a. it's always a comma and
b. you can guarantee that there are no unhelpful characters (such as
")" ) in the field and
c. you can guarantee that the standard list separator in regional
options (in control panel) is a comma, then one possibility would be to
use a nested EQ field (e.g.

{ EQ \a({ MERGEFIELD myfield })}

(in other words, the string should not contain stuff that the EQ field
would misinterpret). Each pair of {} needs to be the special field code
braces that you can insert using ctrl-F9

3. Since (2) is probably a tall order, the other "standard" way to do it
would be to use VBA and Word's Mailmerge events to replace all the
commas by CRLFs and either insert the resulting text directly or use a
DOCVARIABLE field to do it. But let us know if you need to do that.


Peter Jamieson

http://tips.pjmsn.me.uk

On 09/04/2010 16:33, P. Anderson wrote:
I would like to be able to substitue any comma from a {Mergefield field}
result to a return character. Then the Mergefield result "box, top,
carrot, onion" would look like

box
top
carrot
onion

Thank you
P. Anderson

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
Substitute for Letter Wizard Landman Microsoft Word Help 5 June 18th 07 09:45 PM
QuickParts not a substitute for AutocorrectAutotext Greg Gates Microsoft Word Help 16 July 26th 06 05:24 PM
look at the second character in a mergefield in expressions Pat Clifford Mailmerge 1 September 6th 05 12:33 PM
substitute text in header and footer sten Microsoft Word Help 1 June 16th 05 06:36 PM
I am using an unusual font - how can I set the default substitute. Kate Microsoft Word Help 2 May 9th 05 05:12 PM


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