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

Free Support Forum - aspose.com

Nested table with custom formating?


I am using: https://docs.aspose.com/words/net/nested-mail-merge-with-regions/

to create a nested table, it works fine, but i want a handler like the one i use in a normal mail merge which is:

doc.MailMerge.MergeField += new MergeFieldEventHandler(HandleMergeField);

How can i handle the dataset output?



Hi Tjiper,

Please visit this documentation link to work with Mail Merge by using DataSet. If this does not help you then please share your document and code for investigation purposes.

That link doesnt help me.
I want a handler for the dataset.

Hi Tjiper,

The MergeFieldEventHandler has been replaced with IFieldMergingCallback in latest version of Aspose.Words for .NET. Please share some more information about your issue. We are really keen to help you but need some more information from your side.
Can you please also share, which version of Aspose.Words for .NET you are using?

I have a nested table and i am using Dataset from XML file.
I want to have something like:

if (e.mailmerge.name == "something")
    // Do something

Thanks for your request. Please try using the following code example:

Document doc = new Document("in.doc");
// Add FieldMergingCallback. It is needed to achieve what you need.
doc.MailMerge.FieldMergingCallback = new MyMergeFieldCallback();
private class MyMergeFieldCallback: IFieldMergingCallback
    void IFieldMergingCallback.FieldMerging(FieldMergingArgs args)
        // Do something.
    void IFieldMergingCallback.ImageFieldMerging(ImageFieldMergingArgs e)
        // Do something.

Best regards,