View Single Post
  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
macropod macropod is offline
external usenet poster
 
Posts: 1,002
Default Conditional Formatting?

As Graham says, you can't simply copy & paste - you have to use proper field braces (ie '{ }'), which you insert in pairs via
Ctrl-F9. And be careful to keep the same spacing. In:
{IF{MERGEFIELD "CSCS_Test_DateTime" \@ YYYYMMDD} {DATE \@ YYYYMMDD}
{MERGEFIELD "CSCS_Test_DateTime" \@ "d MMM YYYY" \*Charformat} {MERGEFIELD "CSCS_Test_DateTime" \@ "d MMM YYYY" \*Charformat}}

make sure to delete the line feeds and ' ' character strings, so that there is a single space separating the fields.

Probably the easiest way to set the field up is to:
1. insert three copies of your basic mergefield, thus:
«CSCS_Test_DateTime» «CSCS_Test_DateTime» «CSCS_Test_DateTime»
2. Select each field in turn, press Shift-F9 to expose its code and edit it as shown above, adding the formatting as originally
described, then pressing F9 to update the field before moving on to the next one
3. Insert a DATE field between the first pair of mergefields, via Ctrl-F9 to create a pair of field braces, then typing 'DATE' thus:
«CSCS_Test_DateTime» {DATE} «CSCS_Test_DateTime» «CSCS_Test_DateTime»
4. Select all the fields and press Ctrl-F9 to wrap all of them in a single field, thus:
{«CSCS_Test_DateTime» {DATE} «CSCS_Test_DateTime» «CSCS_Test_DateTime»}
5. Add the IF test, making sure to preserve the inter-field spacing, thus:
{IF«CSCS_Test_DateTime»{DATE} «CSCS_Test_DateTime» «CSCS_Test_DateTime»}
Note that there are two spaces.
6. Select the whole lot and press F9 to update.
7. Run your mailmerge.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"JethroUK©" wrote in message ...
Hi

Thanks for that - I tried copy/pasting but i don't think i'm doing right - it just stays as plain text - it doesn't even have the
right-click menu for fields: Update, Edit Toggle field codes

I've even tried pasting each parameter into the 'IF' wizard seperately


"macropod" wrote in message ...
Hi Jethro,

Try:
{IF{MERGEFIELD "CSCS_Test_DateTime" \@ YYYYMMDD} {DATE \@ YYYYMMDD} {MERGEFIELD "CSCS_Test_DateTime" \@ "d MMM YYYY"
\*Charformat} {MERGEFIELD "CSCS_Test_DateTime" \@ "d MMM YYYY" \*Charformat}}
where you format the 'M' in the last two occurrences of 'MERGEFIELD' as you want the output to appear. Change the "d MMM YYYY"
strings to match your preferred date format (eg "dddd, d MMM YYYY", "d/M/YY", etc)

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"JethroUK©" wrote in message ...
I am using excel as a datasource and merging this to create some appointments for some students

{MERGEFIELD "CSCS_Test_DateTime"}

I need to make the appointments pending very distinct from the history (in RED maybe?)

Any way i can do this?

{IF {Mergefield "CSCS_Test_DateTime"} Now()