View Single Post
  #4   Report Post  
Frustrated
 
Posts: n/a
Default

Thank you...it worked! However, it was even simpler than your suggestion.

I used the SET field at the end of my merge codes to define the reference,
and the IF THEN ELSE field to determine the change in Country name:

{IF {MERGE REC} = 1 "{MERGEFIELD Country}" "{IF {MERGEFIELD Country} =
"{Oldvalue}" " " " {MERGEFIELD Country}"}"}

{SET Oldvalue "{MERGEFIELD Country}"

I had tried something similar earlier, but had used my "SET" field BEFORE
the "IF THEN ELSE" field which negated the results.

Now it works like a charm without altering my spreadsheet!



"macropod" wrote:

Hi,

You could build the logic for this into the Word mailmerge document itself,
thus avoiding the need to edit the spreadsheet.

To do this, you could use a SET field to save the value of the previous
record, and a REF field to access that value before updating with the new
value.

You might need to do something special for the first record, along the lines
of:
{IF {MERGEREC}= 1 {SET oldvalue ""}}

From then on, to test the "old" value, you could use:
{IF{Mergefield TFC} = {oldvalue} {Mergefield Country}}

Having done that, you update the "old" value with the "new" value:
{SET oldvalue {MERGEFIELD TFC}}
for use in the next record.

Cheers


"Frustrated" wrote in message
...
I figured out an easy way to refer back to the previous record in a merge

so
as not to enter the same information twice.

I set up a column in the spreadsheet next to the column holding the field

I
wanted to reference. I then used the "EXACT" formula to compare the field
text in the record above with the one below to see if they were the same
(i.e. TRUE) or different (i.e. FALSE) I then copied the formula all the

way
down the column.

Then I used the 'IF-Then-Else" field in my Word merge document: {IF
{Mergefield TFC} = "FALSE" "{Mergefield Country}" " "}.

Works like a charm!

Thankfully, I will not need to use a macro to go back and delete the
unwanted repeated text.