Windows 7 - Conditional Formatting?

Asked By repl on 13-Oct-07 10:36 AM
I am using excel as a datasource and merging this to create some
appointments for some students


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()

macropod replied on 13-Oct-07 09:36 PM
Hi Jethro,

{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)

[MVP - Microsoft Word]
repl replied on 14-Oct-07 05:46 AM

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
Graham Mayor replied on 14-Oct-07 05:49 AM
See your other thread - you cannot copy/paste fields.
You must use CTRL+F9 for each set of fields brackets.

Graham Mayor -  Word MVP

My web site
Word MVP web site
macropod replied on 14-Oct-07 04:53 PM
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:
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.

[MVP - Microsoft Word]
repl replied on 14-Oct-07 06:47 PM
it is working now - I only used CTRL F9 to create the outer pair and I
'still' did not realise I had to use CTRL F9 to create all (5) pairs