View Single Post
 
Old 11-01-2014, 08:51 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
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

A mergefield only outputs the entire information for the corresponding field in the datasource. Any parsing would have to be done via additional field coding. For numeric data and dates, that's not too hard (the links I've already posted employ such techniques). For text, however, every character in the output would have to be tested. Depending on the data, that could mean 100+ tests per character - hardly a practical proposition.

You can also combine mergefields with other fields to conditionally vary the output. An IF field, for example, might be used to test whether a given mergefield consists of, starts with, or ends with, a particular string and vary the output accordingly. The 'Mailmerge Tips & Tricks' sticky thread (https://www.msofficeforums.com/mail-...ps-tricks.html) has various examples of such testing.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote