Hi,
I'm looking at autogenerating a department document and I want to auto generate a chart in this report. The code I got from the internet produces a dated looking chart but I want to be able to use more modern chart. I can find a way of changing styles for Tables but I cant see how I can change a style for a Chart. I'm guessing its something to do with me using MS Chart 8.0 instead of the latest version.
I can see plenty of articles using chart controls in applications but I have to generate this chart in word Programmatically
Code I currently use:
Word.InlineShape oShape;
object oClassType = "MSGraph.Chart.8";
wrdRng = oDoc.Bookmarks.get_Item(ref oEndOfDoc).Range;
oShape = wrdRng.InlineShapes.AddOLEObject(ref oClassType, ref oMissing,
ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing);
object oChart;
object oChartApp;
oChart = oShape.OLEFormat.Object;
oChartApp = oChart.GetType().InvokeMember("Application",
BindingFlags.GetProperty, null, oChart, null);
object[] Parameters = new Object[1];
Parameters[0] = 4;
oChart.GetType().InvokeMember("ChartType", BindingFlags.SetProperty,
null, oChart, Parameters);
oChartApp.GetType().InvokeMember("Update",
BindingFlags.InvokeMethod, null, oChartApp, null);
oChartApp.GetType().InvokeMember("Quit",
BindingFlags.InvokeMethod, null, oChartApp, null);
Would be much appreciated if someone can point me in the right direction