View Single Post
 
Old 07-23-2021, 10:06 AM
BNDCK BNDCK is offline Windows 10 Office 2010
Novice
 
Join Date: Jul 2021
Posts: 2
BNDCK is on a distinguished road
Default Multiple Records in Mail Merge Document in MS Word

I have many Invoices for a single customer to sent for reminding due payments. I have perfectly managed to write Directory solution(data is stored in flat excel sheet ) and the get the desired output letter to be sent each customer.

My Code is here

{ IF { MERGESEQ } = "1"
Date : {Date \@" dd-MM-yyyy" \* MERGEFORMAT }
"Dear { MERGEFIELD Name },

I have herewith attached all Invoices and relevant dates which are pending. Please made arrangements as soon.


Kind Regards,
Paul Samson - Recovery Manager" "" }

{ SET Place1 { MERGEFIELD Customer No }}
{ MERGEFIELD Invoice No } { MERGEFIELD Date}
{ If { Place2 } <> { Place1 }"------page break

Date : {Date \@" dd-MM-yyyy" \* MERGEFORMAT }
"{ MERGEFIELD Name }

I have herewith attached all Invoices and relevant dates which are pending. Please made arrangements as soon.


Kind Regards,
Paul Samson - Recovery Manager" "" }
{ SET Place2 { MERGEFIELD Customer No }}

The above code produces output as follows.
Date : 15-07-2021

Dear John Allen,

I have herewith attached all Invoices and relevant dates which are pending. Please made arrangements as soon.


Kind Regards,
Paul Samson - Recovery Manager

EX4565 25-Mar-21
EX4591 29-Mar-21
EX4674 20-Apr-21
EX4679 13-May-21
EX4700 29-May-21
EX4791 10-Jun-21
EX4824 14-Jun-21
EX4891 21-Jun-21
EX4923 2-Jul-21
EX5110 13-Jul-21
EX5192 24-Jul-21

But I want the to prepare my letter as records in one row since I have many invoices for each customer.

Required Letter like this
Date : 15-07-2021

Dear John Allen,

I have herewith attached all Invoices and relevant dates which are pending. Please made arrangements as soon.


Kind Regards,
Paul Samson - Recovery Manager

EX4565 25-Mar-21 EX4591 29-Mar-21 EX4674 20-Apr-21
EX4679 13-May-21 EX4700 29-May-21 EX4791 10-Jun-21
EX4824 14-Jun-21 EX4891 21-Jun-21 EX4923 2-Jul-21
EX5110 13-Jul-21 EX5192 24-Jul-21

Can someone please point me out a solution to get this done.


Many Thanks
Ben
Reply With Quote