We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

mail merge for multiple images

Dear support,

can you please provide a working blazor server app that will do mailMerge for Multiple images (e.g. by providing a list with filepaths of jpegs) to it?

the code  which is provided on the link below does not workat the point (args.Image = Image.FromFile(ProductFileName);)

https://help.syncfusion.com/file-formats/docio/mail-merge/mail-merge-events?_gl=1*14ezxhr*_ga*MTg4OTgzOTEzMy4xNjc3MTQ5MDc2*_ga_WC4JKKPHH0*MTY3NzE0OTA3NS4xLjEuMTY3NzE0OTA3Ni4wLjAuMA..&_ga=2.210125717.1228922092.1677149076-1889839133.1677149076#mergeimagefield-event


3 Replies

SB Suriya Balamurugan Syncfusion Team February 24, 2023 01:20 PM UTC

Hi Daniel,

From the given details, we have found that your requirement is to perform mail merge for multiple images using MergeImageField event in Blazor Server App.

We have prepared the sample application in Blazor Server App to achieve your requirement and it can be downloaded from the below attachment.

Please refer our UG documentation link to know how to create Word document in Blazor Server App,
https://help.syncfusion.com/file-formats/docio/create-word-document-in-blazor

Regards,
Suriya Balamurugan.

If this post is helpful, please consider accepting it as the solution so that other members can locate it more quickly.



Attachment: Serversideapplication_95f5c84a.zip


DA DAN February 24, 2023 01:53 PM UTC

Dear Suriya,

the sample is not as expected.

we want to perform mail merge for multiple images (the number of it may be different every time).

we should be able to mailmerge All of these image , without specifying for each image a different merge field in template.doc.

on your example there is a specific mergeField name for each image you want to replace with. can you please provided an updated example (.net 6 core, is preferable).



SB Suriya Balamurugan Syncfusion Team February 27, 2023 05:14 PM UTC

Daniel, we have prepared a sample application to perform mail merge for multiple images as per your requirement and it can be downloaded from the below attachment.

Note: Please find the template Word document and images in the “Files” folder of above sample.

We have done the following things in the sample:
  1. Open the template Word document.
  2. Execute mail merge.
  3. Inside the MergeImageFieldEventHandler, load the image using field value.
  4. Insert the picture at the current merge field index.
  5. Similarly, insert the remaining pictures in the next index.
  6. Set field value as empty.
  7. Save the Word document.


Attachment: Serversideapplication_Modified_b18a3b2a.zip

Loader.
Live Chat Icon For mobile
Up arrow icon