Comma

C

chartley

How do I insert a comma only before a merge field that is populated? In
other words, no comma if the merge field following the comma is blank.
 
P

Peter Jamieson

You could use

{ IF "{ MERGEFIELD myfield }" = "" "" ",{ MERGEFIELD myfield }" }

or in Word 2003 and probably 2002 just

{ MERGEFIELD myfield \b , }

should be enough.

You can do the latter by selecting the field and right-clicking, then Edit
Field and fill in the relevant option.

otherwise, use Alt-F9 to view the full field codes, ctrl-F9 to insert each
pair of the special field braces {}, and type the remaining text.

Peter Jamieson
 
C

chartley

Thank you!

Peter Jamieson said:
You could use

{ IF "{ MERGEFIELD myfield }" = "" "" ",{ MERGEFIELD myfield }" }

or in Word 2003 and probably 2002 just

{ MERGEFIELD myfield \b , }

should be enough.

You can do the latter by selecting the field and right-clicking, then Edit
Field and fill in the relevant option.

otherwise, use Alt-F9 to view the full field codes, ctrl-F9 to insert each
pair of the special field braces {}, and type the remaining text.

Peter Jamieson
 

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