title: How to Add Office Graph in word
body: <p>Hi every one this is my first question here. </p>
  
  <p>I want to add a Office Graph in word 2007 using C# 4.0, </p>
  
  <p>I am using Office 2007 word, for better charts like 3D Bubble
  My task is to Genrate Graph and table from sql database i have done it in good menner with using the excel chart then copy chart as image in word.</p>
  
  <p>now i want to add chart itself in word so that the user can change the chart or its value.
  currently i m doing this code.</p>
  
  <pre><code>       object missing = Type.Missing;          
  
          Word.Application application = new
          Microsoft.Office.Interop.Word.Application();
          application.Visible = true;
          Word.Document document = application.Documents.Add(ref missing, ref missing, ref missing,
          ref missing);
          Random rd = new Random();
  
          objchart = (Graph.Chart)document.Shapes.AddOLEObject("MSGraph.Chart.8").OLEFormat.Object;
          dataSheet = objchart.Application.DataSheet;
          for (int r = 1; r &lt; 10; r++)
          { for (int c = 1; c &lt; 5; c++) { dataSheet.Cells[r, c] = rd.Next(10, 50); } }
  </code></pre>
  
  <p>the below code is working fine  but the result is not good as i want. 
  if i use "Excel.Chart.8" insteed of "MSGraph.Chart.8" it gives me error. </p>