>Hi all
>
>MSWord mailmerge generates a letter per record. I need to generate letters with One to Many data from 2 tables.
>I am looking at possibility of doing mailmerge without using MS Word.
>
>Is this possible or is there a better alternative
>
>Your advice is much appreciated
>
>Thanks & Best Regards
I did this once
You need to add a field that indicates when the detail ends
You can control whether to advance a record with the NextIf in the mergefield code
http://office.microsoft.com/en-us/word-help/field-codes-nextif-field-HP005186175.aspxIt was a mailmerge to customers with open invoices
I had a code A for the header, D for detail, and T for Total
The last mergefield of the header (cust name, address, et) had
{NEXTIF {MERGEFIELD type } = "A"}
The body - listing the open invoices
{ if { mergefield type} = "D" { mergefield invoiceamount} }
The field most to the right of the body
{ if { mergefield type} = "D" { mergefield daysopen} } {NEXTIF {MERGEFIELD type } = "D"}
At the end of the page to print the total
{ if { mergefield type} = "T" { mergefield totalamountopen} }
Gregory