Free Support Forum -

Embed an image into ASPOSe.Words document

a) Is it possible to embed lets say a Pie chart into an ASPOSE.Words document..can you point me to an article.

b) If yes, is it possible to edit the Pie chart using excel from above object. Please point me to an article...


Thanks for your request. If I understand you correctly, you mean OLE objects. Inserting new OLE objects into Word documents and updating existing OLE objects is not supported at the moment. Inserting an OLE object usually requires the host application and probably cannot be done by Aspose.Words.

What is supported is preserving OLE objects in documents. That is if you open an MS Word document and then save it (possibly in another MS Word format) then OLE objects are preserved. You can also access objects programmatically, extract their data and preview image. However, creating new OLE objects is not supported.

You will be notified as soon as this feature is supported.

Best regards,

Lets assume i have pie charts or table of organization designed in Visio and saved in a database as a blob object "OR" saved on a fileshare as .gif or.png etc...

Is it possible to embed these objects from database blob object or fileshare in ASPOSE.Words using place holders.


Thanks for your inquiry. No, unfortunately, the nearest versions of Aspose.Words will not allow embedding charts into MS Word documents. But if you save your chart as image, in this case you can try using InsertImage method to insert this image into the document:

Best regards,


yes...i can live with inserting a static image into the document...

unfortunately i couldn't find enough information on your web-site on how to place aspose tags in template for the image as a place holder and use the "InsertImage" method to populate the image at run time.

I have created a dotnet project with all required components.

1) Please use Sample.aspx as startup page , press F5 and click "generatereport" button to view the docoument.

2) My template is in "CommonComponents" folder. I have a PieChart.png in the same folder.

Could you please help me in placing the ASPOSE tags in the template and writing code on button click event using "InsertImage" to place the PieChart.png (.png or .gif etc..).

Note: We have purchased ASPOSE.Words few months back and hold a valid license.



Thanks for your request. I think, in your case, you can use mergefield as placeholder for an image and then insert the image during mail merge. Please follow the link to learn how to achieve this:

Hope this helps.

Best regards,

How to read the image stored on a fileshare and display for mail merge fields.



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

// Prepare dummy data for mail merge

string[] names = { "myImg" };

object[] values = { File.ReadAllBytes("C:\\Temp\\image.jpg") };

Document doc = new Document("C:\\Temp\\in.doc");

// Set up the event handler for image fields.

doc.MailMerge.FieldMergingCallback = new HandleMergeImageFieldFromBlob();

// Perform mail merge.

doc.MailMerge.Execute(names, values);


private class HandleMergeImageFieldFromBlob : IFieldMergingCallback


void IFieldMergingCallback.FieldMerging(FieldMergingArgs args)


// Do nothing.



/// This is called when mail merge engine encounters Image:XXX merge field in the document.

/// You have a chance to return an Image object, file name or a stream that contains the image.


void IFieldMergingCallback.ImageFieldMerging(ImageFieldMergingArgs e)


// The field value is a byte array, just cast it and create a stream on it.

MemoryStream imageStream = new MemoryStream((byte[])e.FieldValue);

// Now the mail merge engine will retrieve the image from the stream.

e.ImageStream = imageStream;



Also please see the attached template.

Best regards,

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

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

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

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