We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Cleanup mail merge fields after performing mail mrege operation using C#

I have generated an excel graph using Aspose cells and then mail merged into word using Aspose words. The problem that I seem to be having is that the mail merge tag is still present in the word document.

ie

<>

(the graph is then displayed below)

How do i remove the mail merge tag? I have tried using

Aspose.Words.Reporting.MailMergeCleanupOptions

with the variouse settings.

Hi James,

Thanks for your query. Please read following documentation links for your kind reference.
How to Remove Unmerged Fields, Empty Paragraphs and Unmerged Regions
Simple Mail Merge Explained
Mail Merge with Regions Explained

Hi James,

Thanks for your inquiry.

While using the latest version of Aspose.Words i.e. 10.8.0, I managed to reproduce this issue on my side. Your request has been linked to the appropriate issue and you will be notified as soon as it is resolved. Sorry for inconvenience.

Moreover, you can respond to MailMerge.FieldMergingCallback event to return a file name, stream, or an Image object to the mail merge engine so that it is inserted into the document. Also, I would suggest you please try using the following work around:

private class HandleMergeImageFieldFromBlob : IFieldMergingCallback

{

void IFieldMergingCallback.FieldMerging(FieldMergingArgs e)

{

}

public void ImageFieldMerging(ImageFieldMergingArgs args)

{

if (args.FieldName.Equals(“TestChart”))

{

DocumentBuilder builder = new DocumentBuilder(args.Document);

builder.MoveToMergeField(" TestChart");

MemoryStream stream = new MemoryStream();

using (Image img = Image.FromFile(@“c:\temp\Chrysanthemum.jpg”))

{

img.Save(stream, ImageFormat.Jpeg);

}

builder.InsertImage(stream.GetBuffer());

}

}

}

I hope, this will help.

That has worked thank you

The issues you have found earlier (filed as WORDSNET-5747) have been fixed in this .NET update and this Java update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.
(52)