INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Word 2010 Is it possible to format MERGEFIELD text based on comparison with another MERGEFIELD?
2

Word 2010 Is it possible to format MERGEFIELD text based on comparison with another MERGEFIELD?

Word 2010 Is it possible to format MERGEFIELD text based on comparison with another MERGEFIELD?

(OP)
Yes, it is possible to ask a stupid question; here goes. I have set up the following MERGEFIELD that will put in either the appointment date, if it exists in the Access database, or "Unknown"

Quote:


1st Appt booked - {IF{MERGEFIELD N2_9_FIRST_SEEN_DATE <> "" "{MERGEFIELD N2_9_FIRST_SEEN_DATE \@ "dd/MM/yyyy"}"Unknown"}

This has saved me a lot of time but it would be awesome if I could underline the date if it were after the target date, (another MERGEFIELD).

Thinking about it, would I be able to use another comparison and then set another text switch? "\* Charformat"

Unfortunately, now I can't see anything "out there" other than formatting dats or currency.

Many thanks,
D€$

RE: Word 2010 Is it possible to format MERGEFIELD text based on comparison with another MERGEFIELD?

You could use a field coded as:
{IF{MERGEFIELD N2_9_FIRST_SEEN_DATE}<> "" {IF{MERGEFIELD N2_9_FIRST_SEEN_DATE \@ YYYYMMDD}>{MERGEFIELD TARGET_DATE \@ YYYYMMDD} {MERGEFIELD N2_9_FIRST_SEEN_DATE \@ "DD/MM/YYYY" \* Charformat} {MERGEFIELD N2_9_FIRST_SEEN_DATE \@ "DD/MM/YYYY"}} "Unknown"}

Cheers
Paul Edstein
[MS MVP - Word]

RE: Word 2010 Is it possible to format MERGEFIELD text based on comparison with another MERGEFIELD?

(OP)
Hi Paul, I reckoned it would be just about that - thanx, but it's the "\* Charformat" bit that I can't find reference to anywhere in order to make it underlined. Any ideas?

Many thanks,
D€$

RE: Word 2010 Is it possible to format MERGEFIELD text based on comparison with another MERGEFIELD?

Hi PWD,

If you look at the field code representation I posted, you'll see that the M of 'MERGEFIELD' in:
{MERGEFIELD N2_9_FIRST_SEEN_DATE \@ "DD/MM/YYYY" \* Charformat}
is underlined.

Cheers
Paul Edstein
[MS MVP - Word]

RE: Word 2010 Is it possible to format MERGEFIELD text based on comparison with another MERGEFIELD?

How arcane! Wow Paul!

Skip,

glassesJust traded in my OLD subtlety...
for a NUance!tongue

RE: Word 2010 Is it possible to format MERGEFIELD text based on comparison with another MERGEFIELD?

My bad, actually. The Charformat switch won't work with a date picture switch. Consequently, the whole field would have to be underlined, as in:
{IF{MERGEFIELD N2_9_FIRST_SEEN_DATE}<> "" {IF{MERGEFIELD N2_9_FIRST_SEEN_DATE \@ YYYYMMDD}>{MERGEFIELD TARGET_DATE \@ YYYYMMDD} {MERGEFIELD N2_9_FIRST_SEEN_DATE \@ "DD/MM/YYYY"} {MERGEFIELD N2_9_FIRST_SEEN_DATE \@ "DD/MM/YYYY"}} "Unknown"}

Cheers
Paul Edstein
[MS MVP - Word]

RE: Word 2010 Is it possible to format MERGEFIELD text based on comparison with another MERGEFIELD?

(OP)
Wow, mucho respec' :) For some reason I have wrapped from after <> "" to before "Unknown" in quote marks but had omitted the trailing quote mark in my post as I'd had to type it as I couldn't find a way to paste the code and not the result! So I've left them in my revised code and it hasn't fallen over. Unfortunately I don't have any records at the moment that pass the test but I'll sure be keeping my eyes open each time I run a bunch of letters.

Many thanks,
D€$

P.S. I've decided to throw in Italic into this mix too, just for nothing!

RE: Word 2010 Is it possible to format MERGEFIELD text based on comparison with another MERGEFIELD?

For a macro to convert text representations of field constructions such as I posted here to working field codes, see Convert Text Representations of Fields to Working Fields in my Mailmerge Tips and Tricks threads at:
http://www.msofficeforums.com/mail-merge/21803-mai...
&:
http://windowssecrets.com/forums/showthread.php/16...
There's a lot of other stuff there you might find useful, too.

Cheers
Paul Edstein
[MS MVP - Word]

RE: Word 2010 Is it possible to format MERGEFIELD text based on comparison with another MERGEFIELD?

(OP)
"Yes Boys!" Just had a couple of sheets where the date was past the target date and they are what I expected !!!! As you say Skip, arcane! But now know to many smarty

Many thanks,
D€$

RE: Word 2010 Is it possible to format MERGEFIELD text based on comparison with another MERGEFIELD?

Update: It seems the \* Charformat switch doesn't work at all on systems with Office set up for use with a RTL keyboard - even if it's not enabled. That's what I had and, now that I've removed the offending setting, everything is back to normal and the field code in post of 23 Aug 2017 works fine.

Cheers
Paul Edstein
[MS MVP - Word]

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close