Hi rebeccabarker,
Maybe an IF THEN ELSE field in Word might help? This feature is available on the Mail Merge Toolbar (View/Toolbars?Mail Merge).
Here are some examples of what it can do:
Examples of IF fields
The IF field performs one of two alternative actions, depending on a condition you specify. For example, the statement "If the weather is sunny, we'll go to the park; if not, we'll go to the movies" specifies a condition that must be met (sunny weather) for a certain action to take place (going to the park). If the condition is not met, an alternative action occurs (going to the movies).
The following IF field is a similar type of statement. If the current data record contains "San Francisco" in the City field, Microsoft Word prints the first text in quotation marks in the merged document that results from that data record. Otherwise, Word prints the second set of text. This example uses the IF and MERGEFIELD fields together.
{ IF { MERGEFIELD City } = "San Francisco" "Please call our local office." "Please return the enclosed form in the provided envelope." }
Word inserts an IF field in this form when you click the Insert Word Field button on the Mail Merge toolbar and then click If...Then...Else.
Here are some examples of ways to modify the IF field codes by using them in concert with other field codes:
Compare a data field with another data field or bookmark
This IF field compares the number in the Rate data field with the number in the Discount data field. If the numbers are equal, the specified text is printed.
{ IF { MERGEFIELD Rate } = { MERGEFIELD Discount } "We will offer you a larger discount. " " " }
(If number in the Rate data field does not equal the number in the Discount field, no text is printed.)
Example 1
If the condition specified by this IF field is met, the INCLUDETEXT field inserts the contents of the indicated document. To specify the location and file name of the included document, use double backslash (\\) characters, as shown in the example. If the condition is not met, Word inserts the AutoText entry "Copyright."
{ IF { MERGEFIELD State } = "NY" "{ INCLUDETEXT c:\\worddocs\\contract.doc }" "{ AUTOTEXT Copyright }" }
Example 2
If the Company data field for a data record contains any information— that is, if the field is not blank— Word prints text from the CompanyAddress field. Otherwise, Word prints text from the HomeAddress field.
{ IF { MERGEFIELD Company } <> " " "{ MERGEFIELD CompanyAddress }" "{ MERGEFIELD HomeAddress }" }
Perform calculations in an IF field
In this example, the first = (Formula) field in the following example computes the current balance of each account. If a balance remains, the Formula field is repeated to report the current balance. If the computed balance is 0 (zero) or less, Word prints the alternative text, "Your account is paid in full. Thank you."
{ IF { = { MERGEFIELD Balance } - {MERGEFIELD Payment } } > 0 "Your current balance is { = { MERGEFIELD Balance } - { MERGEFIELD Payment } \# "$#,##0.00; " }." "Your account is paid in full. Thank you." }
Specify multiple conditions
You can specify multiple conditions by nesting a COMPARE field or another IF field inside an IF field.
Example 1
In this example, COMPARE fields examine the data fields CustomerNumber and CustomerRating as Word merges each data record. The AND function of the = (Formula) field returns a value of "1" (true) if both of the data field values indicate a satisfactory account, in which case Word prints the first text in quotation marks.
{ IF { = AND ( { COMPARE { MERGEFIELD CustomerNumber } >= 4 }, { COMPARE { MERGEFIELD CustomerRating } <= 3 } ) } = 1 "Satisfactory" "Unsatisfactory"}
Example 2
In this example, special rates are offered only to residents of California or Washington. If the State field specifies any other state, no additional text is printed because no alternative text has been specified in the second IF field.
{IF {MERGEFIELD State} = "CA" "For California residents, we offer special rates to Asia and Japan." "{IF {MERGEFIELD State} = "WA" "For Washington residents, we offer special rates to Asia and Japan." " "} "}
HTH,
Best,
Blue Horizon