![]() |
#1
|
|||
|
|||
![]()
Good morning,
I am seeking help with nested if statements in mail merge & am going around in circles trying to figure out. I need to create a paragraph with the following conditions - IF (Mergefield Cover Type) is E1 and (Mergefield Overseas) is not blank "Sentence for this cover" Then the rest of the paragraph needs to return different values depending on one to three conditions at a time (I am attempting to nest it all together) - IF (Mergefield Waits Apply) = Y "Sentence for waits apply" or IF (Mergefield Waits Apply) = Y and (Mergefield Previous Extras) = N "Sentence for previous extras" or IF (Mergefield Waits Apply) = Y and (Mergefield Previous Extras) = Y and (Mergefield Upgrade Extras) = Y "Sentence for upgrading waits" They need to return a blank if they are not true Any assistance from your logical minds would be greatly appreciated ![]() Renee |
#2
|
||||
|
||||
![]()
From what you describe, your fields should be coded as:
Code:
{IF{MERGEFIELD Cover_Type}= "E1" {IF{MERGEFIELD Overseas}<> "" "Sentence for this cover"}} Code:
{IF{MERGEFIELD Waits_Apply}= "Y" {IF{MERGEFIELD Previous_Extras}= "Y" "Sentence for upgrading waits" "Sentence for previous extras"} "Sentence for waits apply"} Code:
{IF{MERGEFIELD Waits_Apply}= "Y" {IF{MERGEFIELD Previous_Extras}= "Y" "Sentence for upgrading waits" {IF{MERGEFIELD Previous_Extras}= "N" "Sentence for previous extras" "Sentence for not Y/N"}} "Sentence for waits apply"} Note: The field brace pairs (i.e. '{ }') for the above examples are all created in the document itself, via Ctrl-F9 (Cmd-F9 on a Mac or, if you’re using a laptop, you might need to use Ctrl-Fn-F9); you can't simply type them or copy & paste them from this message. Nor is it practical to add them via any of the standard Word dialogues. The spaces represented in the field constructions are all required. For a macro to convert the above field code representations into working field codes, see Convert Text Representations of Fields to Working Fields in the Mailmerge Tips and Tricks 'Sticky' thread at the top of this page: https://www.msofficeforums.com/mail-...ps-tricks.html
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
The following may also assist:
I recommend downloading and saving Paul Edstein's Mailmerge Tips and Tricks. Read it. It will help with more than this problem. |
#4
|
|||
|
|||
![]()
Thank you for your assistance Paul & Charles, all sorted now
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Utang | Mail Merge | 2 | 03-11-2024 03:35 AM |
![]() |
SCOATS | Mail Merge | 3 | 06-05-2019 06:55 PM |
![]() |
Jennifert | Mail Merge | 2 | 05-01-2019 09:40 PM |
I know nothing about mail merge, but need help with conditional statements | briyosa | Word | 1 | 03-27-2017 10:17 PM |
![]() |
ajh19742000 | Mail Merge | 1 | 11-01-2016 06:11 PM |