Reputation: 64
Is it possible to insert System.Windows.Forms.DataVisualization.Charting control into ms word document via Microsoft.Office.Interop.Word?
Alternative solution is to save the chart as image and insert, but the image looks ugly.
Upvotes: 2
Views: 300
Reputation: 25663
No, it's not possible to insert "naked" .NET controls into a Word document - Word simply does not know how to handle them.
Using VSTO it's possible, since VSTO "wraps" the controls into a COM ActiveX control that Word is able to handle. That's something developers can do, themselves, but requires a lot of work. There are discussions on the topic in the VSTO forum on MSDN, for example
https://social.msdn.microsoft.com/Forums/vstudio/en-US/1997b2c1-9806-4334-b99f-77f3333f8189/activex-control-development-for-ms-word?forum=vsto https://social.msdn.microsoft.com/Forums/vstudio/en-US/bc044717-9a83-4a66-992e-0c0664de9928/word-addin-and-winform-control?forum=vsto
Upvotes: 1