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

Free Support Forum - aspose.com

MailMerge both XML file and image files

Hello all. I have scoured all over for help on a problem I am having and hope I can get some help on this. I have an Azure storage blob that will contain a docx, XML and image files. I am tasked with creating an Azure function that will pull down the previously mentioned files and merge them using Aspose.Words. I got the XML merging right (see abbreviated code below):

            DataSet ds = new DataSet();
            ds.ReadXml(xmlStream, XmlReadMode.InferSchema);
            Document doc = new Document(templateStream);

Now comes the images. I have tried a second MailMerge by doing something like the following:

	string[] names = {"SomeImage" };
	string[] values = { @"https://xxxxxxx.blob.core.windows.net/SomeContainer/SomeImage.jpeg" };
	doc.MailMerge.Execute(names, values);	

The MailMergeTag within the docx for the image is <Image:SomeImage>. This overall process I am doing is probably not the correct/best way to do this and would greatly appreciate any other suggestions or help.


Please ZIP and upload your sample input Word document and XML file here for testing. We will then investigate the scenario on our end and provide you more information.