#1   Report Post  
theryno
 
Posts: n/a
Default Hide merge fields

How do I hide a mail merge field if it meets a certain condition (can I use
the IF statement, if so how?)? For instance if STATE="California" then I
want the mail merge field (i.e. State Abbreviation) to show, if not, I do
not want it visible.
  #2   Report Post  
Charles Kenyon
 
Posts: n/a
Default

That is what the IF field is for.

{ IF {MergeField "State" } = "California" "CA" }

Didn't see the sense of including another mergefield if the only state is
California, if you need the mergefield, insert that instead.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

"theryno" wrote in message
...
How do I hide a mail merge field if it meets a certain condition (can I
use
the IF statement, if so how?)? For instance if STATE="California" then I
want the mail merge field (i.e. State Abbreviation) to show, if not, I
do
not want it visible.



  #3   Report Post  
theryno
 
Posts: n/a
Default

I guess I should not have used State Abbrev as an example.

If the state is California, I would want to show the division number,
otherwise show nothing. Would I then use:
{ IF {MergeField "State" } = "California" Division_No }?

THANK YOU!!!

"Charles Kenyon" wrote:

That is what the IF field is for.

{ IF {MergeField "State" } = "California" "CA" }

Didn't see the sense of including another mergefield if the only state is
California, if you need the mergefield, insert that instead.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.


  #4   Report Post  
Charles Kenyon
 
Posts: n/a
Default

I would use:
{ IF {MergeField "State" } = "California" {MergeField Division_No} }
I definitely like to make my MergeField and Ref field references explicit.
It makes debugging a lot easier. Remember that the braces must be inserted
by Word, not just typed. I sometimes put quotation marks around my
mergefields in IF fields and calculation fields. That may just be
superstitious behavior on my part, though.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.

"theryno" wrote in message
...
I guess I should not have used State Abbrev as an example.

If the state is California, I would want to show the division number,
otherwise show nothing. Would I then use:
{ IF {MergeField "State" } = "California" Division_No }?

THANK YOU!!!

"Charles Kenyon" wrote:

That is what the IF field is for.

{ IF {MergeField "State" } = "California" "CA" }

Didn't see the sense of including another mergefield if the only state is
California, if you need the mergefield, insert that instead.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.




  #5   Report Post  
Graham Mayor
 
Posts: n/a
Default

I *always* put quotes around the field results in IF constructions and
calculations - even where they are not strictly required - because it makes
the statements easier to debug.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org




Charles Kenyon wrote:
I would use:
{ IF {MergeField "State" } = "California" {MergeField Division_No} }
I definitely like to make my MergeField and Ref field references
explicit. It makes debugging a lot easier. Remember that the braces
must be inserted by Word, not just typed. I sometimes put quotation
marks around my mergefields in IF fields and calculation fields. That
may just be superstitious behavior on my part, though.

"theryno" wrote in message
...
I guess I should not have used State Abbrev as an example.

If the state is California, I would want to show the division number,
otherwise show nothing. Would I then use:
{ IF {MergeField "State" } = "California" Division_No }?

THANK YOU!!!

"Charles Kenyon" wrote:

That is what the IF field is for.

{ IF {MergeField "State" } = "California" "CA" }

Didn't see the sense of including another mergefield if the only
state is California, if you need the mergefield, insert that
instead. --
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ASK and FILLIN fields in INCLUDETEXT documents do not merge correc ChrisM Mailmerge 3 April 12th 05 04:05 AM
Can you create a multi-layered merge where certain merge fields a. mileszat Mailmerge 3 January 18th 05 03:46 AM
Merge Fields in Header? Joseph N. Mailmerge 4 December 14th 04 10:23 AM
Merge Fields, Headers, Etc. Joseph N. Mailmerge 3 December 11th 04 12:09 AM
Using MAILMERGE fields within HYPERLINK fields for Merge to Email Mark V Mailmerge 2 December 4th 04 04:01 PM


All times are GMT +1. The time now is 02:17 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"