Remove the last line break in a table cell

Hello,

We’re using Aspose.Word 11.10.0.0 with the MailMerge functionnality.

I’ve got a template with a table cell containing many rows, each of them separated by a new line char.

{REF STCCommStreet}
{REF STCCommCity}
{REF STCCommCountry}

When it is a country other than ours, country is empty. It result as Table cell with an empty line at the end. It’s due to the character ‘carriage return’ at the end of the merge field {REF STCCommCity}.

How can I remove the ‘carriage return’ at the end of that merge field or remove the last blank line? (Sorry if the question seems basic but I’m new on this API).

NB: We put CleanupOptions on MailMergeCleanupOptions.RemoveEmptyParagraphs;

Regards,

Xavier

@Garghanuman,

Thanks for your inquiry. Please ZIP and attach your input, output and expected output Word documents here for testing. We will investigate the issue on our side and provide you more information.