Free Support Forum - aspose.com

Aspose word labels

We use aspose to create and print Avery 5160 labels. Empty labels show the merge fields rather than leaving blank. How can I make the empty labels blank?

Hi

Thanks for your request. If you mean mergefields then you can use the following code to remove mergefields.

string[] names = doc.MailMerge.GetFieldNames();

DocumentBuilder builder = new DocumentBuilder(doc);

for (int i = 0; i < names.Length; i++)

{

builder.MoveToMergeField(names[i]);

}

I hope that this will help you.

Best regards.

where do I put that code? on the first label?

do i put the code on the first label?

Hi

You should put this code before saving document.

Best regards.