We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

No empty lines in address block (Mailmerge DocIO)

Hi,

I'm using the mailmerge feature from Syncfusion DocIO. In Word I try to create a simple address block like the sample below. It contains some mergefields and works fine.

«Lastname» «Firstname»
«Address1»
«Address2»
«ZipCode» «City»

{ MERGEFIELD Lastname \* MERGEFORMAT } { MERGEFIELD Firstname \* MERGEFORMAT } 
{ MERGEFIELD Address1 \* MERGEFORMAT } 
{ MERGEFIELD Address2 \* MERGEFORMAT } 
{ MERGEFIELD ZipCode \* MERGEFORMAT } { MERGEFIELD City \* MERGEFORMAT } 

But when a data record has an empty Address1 or Address2, no line should be empty in the address block. In this case next mergefield should follow. In Word it's possible to solve it with "\f", another wayis to create a IF THEN field. With DocIO both options doesn't work.

{ MERGEFIELD Lastname \* MERGEFORMAT } { MERGEFIELD Firstname \* MERGEFORMAT } 
{ MERGEFIELD Address1 \f \* MERGEFORMAT } 
{ MERGEFIELD Address2 \f \* MERGEFORMAT } 
{ MERGEFIELD ZipCode \* MERGEFORMAT } { MERGEFIELD City \* MERGEFORMAT } 

How can I do this? Thanks a lot for your help.

Kind regards
Christian

3 Replies

PL Pradeep Loganathan Syncfusion Team November 11, 2015 09:56 AM UTC

Hi Christian,

Thank you for interest in Syncfusion products.

By enabling MailMerge.RemoveEmptyParagraphs option, then there is no empty paragraph(s) in your document. If the data table contains empty data record while performing mail merge process.
Please refer to the following UG documentation for how to use this option in DocIO:
http://help.syncfusion.com/file-formats/docio/working-with-mailmerge#removing-empty-merge-fields
Please let us know if you have any concerns on this.
Thanks,
Pradeep L


CZ Christian Zeder November 12, 2015 04:45 PM UTC

Hi Pradeep 

Thanks a lot, it works.

Kind regards
Christian 


SR Suganya Rathinam Syncfusion Team November 13, 2015 06:20 AM UTC

Hi Christian,

Thank you for your update. Please let us know if you have any other questions. We will be happy to assist you as always.

Regards,
Suganya


Loader.
Up arrow icon