Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
Using Word 2003, I'd like to suppress a merge field if certain conditions
exist, along with the preceeding and following text. I've been using the MergeField options (obtained when I right click on a merge field and choose Edit Field): Text to be included before & Text to be included after to combine my merge field with text. If I look at the Field Codes after setting up my text, I see... MERGEFIELD Rubella_Due_DAte \b "We show that your auto insurance expires on " \f ". Please submit proof of insurance including your name and new expiration date." Is there a way I can add an If, then, else to this so that If MERGEFIELD Rubella_Due-DAte = 00/00/00 the merge field and it's preceding and following text is suppressed? Can I simply edit the Field Codes text to include this? I apologize if this is a dumb question. I'm new to conditional formatting in Word. I'd also appreciate any pointers to good documents or books on this topic. Thanks, -- Julie |
#2
![]() |
|||
|
|||
![]()
Hi Julie,
Try: {IF{MERGEFIELD Rubella_Due-Date \@ yyyyMMdd}= 0 "" ""We show that your auto insurance expires on {MERGEFIELD Rubella_Due-Date \@ dd/MM/yyyy}. Please submit proof of insurance including your name and new expiration date."} Cheers "julie" wrote in message ... Using Word 2003, I'd like to suppress a merge field if certain conditions exist, along with the preceeding and following text. I've been using the MergeField options (obtained when I right click on a merge field and choose Edit Field): Text to be included before & Text to be included after to combine my merge field with text. If I look at the Field Codes after setting up my text, I see... MERGEFIELD Rubella_Due_DAte \b "We show that your auto insurance expires on " \f ". Please submit proof of insurance including your name and new expiration date." Is there a way I can add an If, then, else to this so that If MERGEFIELD Rubella_Due-DAte = 00/00/00 the merge field and it's preceding and following text is suppressed? Can I simply edit the Field Codes text to include this? I apologize if this is a dumb question. I'm new to conditional formatting in Word. I'd also appreciate any pointers to good documents or books on this topic. Thanks, -- Julie |
#3
![]() |
|||
|
|||
![]()
An extra quote mark sneaked in to Macropod's reply - try
{IF{MERGEFIELD Rubella_Due-Date \@ yyyyMMdd}= 0 "" "We show that your auto insurance expires on {MERGEFIELD Rubella_Due-Date \@ dd/MM/yyyy}. Please submit proof of insurance including your name and new expiration date."} With some versions of Word setting a nul result as the first option can cause the wrong data to be entered. I therefore prefer to avoid this by reversing the conditions thus: {IF{MERGEFIELD Rubella_Due-Date \@ yyyyMMdd} 0 "We show that your auto insurance expires on {MERGEFIELD Rubella_Due-Date \@ dd/MM/yyyy}. Please submit proof of insurance including your name and new expiration date."} The result should be the same. There is some information on field formatting on my web site at http://www.gmayor.com/formatting_word_fields.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org macropod wrote: Hi Julie, Try: {IF{MERGEFIELD Rubella_Due-Date \@ yyyyMMdd}= 0 "" ""We show that your auto insurance expires on {MERGEFIELD Rubella_Due-Date \@ dd/MM/yyyy}. Please submit proof of insurance including your name and new expiration date."} Cheers "julie" wrote in message ... Using Word 2003, I'd like to suppress a merge field if certain conditions exist, along with the preceeding and following text. I've been using the MergeField options (obtained when I right click on a merge field and choose Edit Field): Text to be included before & Text to be included after to combine my merge field with text. If I look at the Field Codes after setting up my text, I see... MERGEFIELD Rubella_Due_DAte \b "We show that your auto insurance expires on " \f ". Please submit proof of insurance including your name and new expiration date." Is there a way I can add an If, then, else to this so that If MERGEFIELD Rubella_Due-DAte = 00/00/00 the merge field and it's preceding and following text is suppressed? Can I simply edit the Field Codes text to include this? I apologize if this is a dumb question. I'm new to conditional formatting in Word. I'd also appreciate any pointers to good documents or books on this topic. Thanks, -- Julie |
#4
![]() |
|||
|
|||
![]()
Thank you both for your quick help. I've tried to paste the example into the
Advanced Field Properties Field Codes field and even when I can get the whole string in, I don't get an active OK button. Is there a trick to this or another place I should go to edit the statement? Thanks again, -- Julie "Graham Mayor" wrote: An extra quote mark sneaked in to Macropod's reply - try {IF{MERGEFIELD Rubella_Due-Date \@ yyyyMMdd}= 0 "" "We show that your auto insurance expires on {MERGEFIELD Rubella_Due-Date \@ dd/MM/yyyy}. Please submit proof of insurance including your name and new expiration date."} With some versions of Word setting a nul result as the first option can cause the wrong data to be entered. I therefore prefer to avoid this by reversing the conditions thus: {IF{MERGEFIELD Rubella_Due-Date \@ yyyyMMdd} 0 "We show that your auto insurance expires on {MERGEFIELD Rubella_Due-Date \@ dd/MM/yyyy}. Please submit proof of insurance including your name and new expiration date."} The result should be the same. There is some information on field formatting on my web site at http://www.gmayor.com/formatting_word_fields.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org macropod wrote: Hi Julie, Try: {IF{MERGEFIELD Rubella_Due-Date \@ yyyyMMdd}= 0 "" ""We show that your auto insurance expires on {MERGEFIELD Rubella_Due-Date \@ dd/MM/yyyy}. Please submit proof of insurance including your name and new expiration date."} Cheers "julie" wrote in message ... Using Word 2003, I'd like to suppress a merge field if certain conditions exist, along with the preceeding and following text. I've been using the MergeField options (obtained when I right click on a merge field and choose Edit Field): Text to be included before & Text to be included after to combine my merge field with text. If I look at the Field Codes after setting up my text, I see... MERGEFIELD Rubella_Due_DAte \b "We show that your auto insurance expires on " \f ". Please submit proof of insurance including your name and new expiration date." Is there a way I can add an If, then, else to this so that If MERGEFIELD Rubella_Due-DAte = 00/00/00 the merge field and it's preceding and following text is suppressed? Can I simply edit the Field Codes text to include this? I apologize if this is a dumb question. I'm new to conditional formatting in Word. I'd also appreciate any pointers to good documents or books on this topic. Thanks, -- Julie |
#5
![]() |
|||
|
|||
![]()
You need to create this field by hand. Press Ctrl+F9 to insert field
delimiters (the things that look like braces but can't be entered from the keyboard) and type the text between them (you'll need to insert the merge fields from the Mail Merge toolbar or by entering another hand-constructed field). -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "julie" wrote in message ... Thank you both for your quick help. I've tried to paste the example into the Advanced Field Properties Field Codes field and even when I can get the whole string in, I don't get an active OK button. Is there a trick to this or another place I should go to edit the statement? Thanks again, -- Julie "Graham Mayor" wrote: An extra quote mark sneaked in to Macropod's reply - try {IF{MERGEFIELD Rubella_Due-Date \@ yyyyMMdd}= 0 "" "We show that your auto insurance expires on {MERGEFIELD Rubella_Due-Date \@ dd/MM/yyyy}. Please submit proof of insurance including your name and new expiration date."} With some versions of Word setting a nul result as the first option can cause the wrong data to be entered. I therefore prefer to avoid this by reversing the conditions thus: {IF{MERGEFIELD Rubella_Due-Date \@ yyyyMMdd} 0 "We show that your auto insurance expires on {MERGEFIELD Rubella_Due-Date \@ dd/MM/yyyy}. Please submit proof of insurance including your name and new expiration date."} The result should be the same. There is some information on field formatting on my web site at http://www.gmayor.com/formatting_word_fields.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org macropod wrote: Hi Julie, Try: {IF{MERGEFIELD Rubella_Due-Date \@ yyyyMMdd}= 0 "" ""We show that your auto insurance expires on {MERGEFIELD Rubella_Due-Date \@ dd/MM/yyyy}. Please submit proof of insurance including your name and new expiration date."} Cheers "julie" wrote in message ... Using Word 2003, I'd like to suppress a merge field if certain conditions exist, along with the preceeding and following text. I've been using the MergeField options (obtained when I right click on a merge field and choose Edit Field): Text to be included before & Text to be included after to combine my merge field with text. If I look at the Field Codes after setting up my text, I see... MERGEFIELD Rubella_Due_DAte \b "We show that your auto insurance expires on " \f ". Please submit proof of insurance including your name and new expiration date." Is there a way I can add an If, then, else to this so that If MERGEFIELD Rubella_Due-DAte = 00/00/00 the merge field and it's preceding and following text is suppressed? Can I simply edit the Field Codes text to include this? I apologize if this is a dumb question. I'm new to conditional formatting in Word. I'd also appreciate any pointers to good documents or books on this topic. Thanks, -- Julie |
#6
![]() |
|||
|
|||
![]()
Thank you all. I have this working beautifully.
Now, I have another challenge (if anyone is willing to help). I'd like to compare the merge field date to today's date + 2 months (e.g., if today is 11/11/2005 and the merge date is 1/1/2006 or greater, I'd like to supress the merge field and text). Here's what I've been working with to see if I can insert Field Date in the field code to start with, but this produces nothing (not even an error). I'd appreciate any ideas you have. Once I get this working, then I'd need to figure out how to add two months to the system date. The following is what I see when I press SHIFT + F9... {IF «Lic_1_Exp_date» = {DATE \* MERGEFORMAT} "" "We show that your driver's license expires on {MERGEFIELD "Lic_1_Exp_date"}. Please submit an updated copy of your driver's license."} Thank you again. -- Julie "Suzanne S. Barnhill" wrote: You need to create this field by hand. Press Ctrl+F9 to insert field delimiters (the things that look like braces but can't be entered from the keyboard) and type the text between them (you'll need to insert the merge fields from the Mail Merge toolbar or by entering another hand-constructed field). -- Suzanne S. Barnhill Microsoft MVP (Word) Words into Type Fairhope, Alabama USA Word MVP FAQ site: http://word.mvps.org Email cannot be acknowledged; please post all follow-ups to the newsgroup so all may benefit. "julie" wrote in message ... Thank you both for your quick help. I've tried to paste the example into the Advanced Field Properties Field Codes field and even when I can get the whole string in, I don't get an active OK button. Is there a trick to this or another place I should go to edit the statement? Thanks again, -- Julie "Graham Mayor" wrote: An extra quote mark sneaked in to Macropod's reply - try {IF{MERGEFIELD Rubella_Due-Date \@ yyyyMMdd}= 0 "" "We show that your auto insurance expires on {MERGEFIELD Rubella_Due-Date \@ dd/MM/yyyy}. Please submit proof of insurance including your name and new expiration date."} With some versions of Word setting a nul result as the first option can cause the wrong data to be entered. I therefore prefer to avoid this by reversing the conditions thus: {IF{MERGEFIELD Rubella_Due-Date \@ yyyyMMdd} 0 "We show that your auto insurance expires on {MERGEFIELD Rubella_Due-Date \@ dd/MM/yyyy}. Please submit proof of insurance including your name and new expiration date."} The result should be the same. There is some information on field formatting on my web site at http://www.gmayor.com/formatting_word_fields.htm -- Graham Mayor - Word MVP My web site www.gmayor.com Word MVP web site http://word.mvps.org macropod wrote: Hi Julie, Try: {IF{MERGEFIELD Rubella_Due-Date \@ yyyyMMdd}= 0 "" ""We show that your auto insurance expires on {MERGEFIELD Rubella_Due-Date \@ dd/MM/yyyy}. Please submit proof of insurance including your name and new expiration date."} Cheers "julie" wrote in message ... Using Word 2003, I'd like to suppress a merge field if certain conditions exist, along with the preceeding and following text. I've been using the MergeField options (obtained when I right click on a merge field and choose Edit Field): Text to be included before & Text to be included after to combine my merge field with text. If I look at the Field Codes after setting up my text, I see... MERGEFIELD Rubella_Due_DAte \b "We show that your auto insurance expires on " \f ". Please submit proof of insurance including your name and new expiration date." Is there a way I can add an If, then, else to this so that If MERGEFIELD Rubella_Due-DAte = 00/00/00 the merge field and it's preceding and following text is suppressed? Can I simply edit the Field Codes text to include this? I apologize if this is a dumb question. I'm new to conditional formatting in Word. I'd also appreciate any pointers to good documents or books on this topic. Thanks, -- Julie |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Creating dynamic cross reference links in a Word document | Microsoft Word Help | |||
Next Record merge field with text boxes | Mailmerge | |||
HTML text in Merge Field | Mailmerge | |||
Word not to insert a merge field if the text or value is 0 | Mailmerge | |||
Text Form Field Ref in Footer Won't Update on Screen | Microsoft Word Help |