Mail merge and multiple images?

It appears that with mail merge, only one image can be merged per operation with IFieldMergingCallback? Can multiple images be merged in a single merge execution?

Hi there,

Thanks for your inquiry. The IFieldMergingCallback.ImageFieldMerging method is called when the Aspose.Words mail merge engine is about to insert an image into a merge field. This method is called for each record of data source if there is mail merge image field (Image:MyFieldName) in the template document. However, you can write code in this method to insert multiple images in the document using DocumentBuilder.InsertImage.

Could you please share complete detail of your use case along with input and expected output documents? We will then provide you more information about your query.

Thanks for the response. I don’t have a specific use case yet I’m just trying to determine what can be done. I know that I will need to be able to insert multiple images in a mail merge document at some point. Can you provide a small sample of how that could be done with the scenarios you described? For instance, let’s say I have a document that has a logo on the top left and another image at top right, and maybe a product image below the top right image. How would I do that? I tried using mail merge with ImageFieldMerging for two images but I got exceptions.

Nevermind, I got it working.

Hi there,

Thanks for your feedback. It is nice to hear from you that your problem has been solved. Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.