Tom Knowlton
asked on
C# Automation in MS Word 2007
How do you programmatically insert a pie chart or a bar graph using C# MS Word automation?
I need sample code.
I need sample code.
ASKER
MS Word 2007.
It looks like this works:
//Insert a chart.
Microsoft.Office.Interop.W ord.Inline Shape oShape;
object oClassType = "MSGraph.Chart.8";
wrdRng = oDoc.Bookmarks.get_Item(re f oEndOfDoc).Range;
oShape = wrdRng.InlineShapes.AddOLE Object(ref oClassType, ref oMissing,
ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing);
It looks like this works:
//Insert a chart.
Microsoft.Office.Interop.W
object oClassType = "MSGraph.Chart.8";
wrdRng = oDoc.Bookmarks.get_Item(re
oShape = wrdRng.InlineShapes.AddOLE
ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing);
ASKER
Looks like I can tweak this line:
object oClassType = "MSGraph.Chart.8";
object oClassType = "MSGraph.Chart.8";
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It works.
do you knwo hwo to write code in ms word ?