View Single Post
 
Old 12-17-2012, 07:05 PM
macropod's Avatar
macropod macropod is online now Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,350
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

In a similar vein, the following construction can be used to manage data where one or more related fields (A, B, C, D, E, & F) may or may not be populated.
{MERGEFIELD A}{IF{MERGEFIELD C}= " " " and {MERGEFIELD B}" ", {MERGEFIELD B}{IF{MERGEFIELD D}= " " " and {MERGEFIELD C}" ", {MERGEFIELD C}{IF{MERGEFIELD E}= " " " and {MERGEFIELD D}" ", {MERGEFIELD D}{IF{MERGEFIELD F}= " " " and {MERGEFIELD E}" ", {MERGEFIELD E} and {MERGEFIELD F}"}"}"}"}

Note 1: It is assumed that none of the fields after the first empty one will be populated.

Note 2: The field brace pairs (ie '{ }') for the above example are created in the body of the document via Ctrl-F9 (Cmd-F9 on a Mac) - you can't simply type them or copy & paste them from this message.

Note 3: A macro to convert the above constructions to working fields is available at: http://www.gmayor.com/export_field.htm#TextToField
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote