Inserting EXCEL charts into Word

I have a requirement to generate a chart (this can be done in Excel), then place this chart into a Word report. I have looked through documentation for Cells and Word and also searched the forum, but can’t find anything that tells me how to do this

Can you help?

Hi,

Thanks for your request. Unfortunately, The requested feature is not supported yet. This feature is scheduled to be introduced in the future release of Aspose.Words. You will be updated via this forum thread once this feature is available.

Would there be a way to save an Excel chart as an image and then import the image into Word?

Hi

You can convert Excel chart to image by using Aspose.Cells and then insert this image into Word document using Aspose.Words. Here is a sample code that demonstrates how to insert chart from Excel to Word as EMF image:

// Open workbook and get collectionof charts on the first sheet.
Workbook wb = new Workbook(@"Test001\test.xlsx");
ChartCollection charts = wb.Worksheets[0].Charts;
// Create DocumentBuilder that will allow us to insert images into Word document.
DocumentBuilder builder = new DocumentBuilder();
foreach(Chart chart in charts)
{
    // COnvert each chart to EMF (vector) image and insert into word document.
    using(MemoryStream chartStream = new MemoryStream())
    {
        chart.ToImage(chartStream, ImageFormat.Emf);
        chartStream.Position = 0;
        builder.InsertImage(chartStream);
    }
}
// Save the result.
builder.Document.Save(@"Test001\out.doc");

can image be inserted into an existing word document?

We wish to open a template document and place an image into it at a specified location

Hi
Thanks for your request. Sure, you can insert images into an existing document. You can use bookmark or mergefield to mark a place where the image should be inserted. In case of using bookmarks, you should simply move DocumentBuilder cursor to the bookmark using MoveToBookmark method and then insert the image.
In case of using mergefield, you can use the approach suggested here to insert the image:
https://docs.aspose.com/words/net/types-of-mail-merge-operations/
Hope this helps.
Best regards,

Hi, when will this feature be available?

Hi Oliver,

I have verified the status of WORDSNET-4617 from our issue tracking system and regret to share with you that this feature is pending for analysis and is in the queue.

The status of WORDSNET-3860 is “In development”. We can not provide you any ETA about these features at the moment. However, We will update you via this forum thread once these features are available.

WORDSNET-4617 : Allow creating OOXML charts and diagrams from scratch.
WORDSNET-3860 : Support rendering OOXML Charts, DrawingML chart disappears while rendering.

We apologize for your inconvenience.

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

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

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.
(30)