Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Oh. no body is here give the answer for my question. let me help my self. I have written these code for above problem and its word fine. hope help u too.</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); object classtype = "Excel.Chart.8"; object oEndOfDoc = "\\endofdoc"; Word.InlineShape wrdInlineShape = document.InlineShapes.AddOLEObject(classtype); if (wrdInlineShape.OLEFormat.ProgID == "Excel.Chart.8") { // Word doesn't keep all of its embedded objects in the running state all the time. // In order to access the interface you first have to ensure the object is in the running state, // ie: OLEFormat.Activate() (or something) object verb = Word.WdOLEVerb.wdOLEVerbHide; wrdInlineShape.OLEFormat.DoVerb(ref verb); Random rn = new Random(); Excel.Workbook obook = (Excel.Workbook)wrdInlineShape.OLEFormat.Object; Excel.Worksheet sheet = (Excel.Worksheet)obook.Worksheets["Sheet1"]; for (int i = 1; i &lt;= 7; i++) { for (int c = 1; c &lt;= 4; c++) { ((Excel.Range)sheet.Cells[i, c]).Value = rn.Next(10, 50); ((Excel.Range)sheet.Cells[i, c]).Value = rn.Next(10, 50); } } wrdInlineShape.Width = 400; obook.ActiveChart.ChartType = Excel.XlChartType.xlBubble3DEffect; Word.Range wrdRng = document.Bookmarks.get_Item(ref oEndOfDoc).Range; object oRng = document.Bookmarks.get_Item(ref oEndOfDoc).Range; wrdRng = document.Bookmarks.get_Item(ref oEndOfDoc).Range; sheet.UsedRange.Copy(); document.SetDefaultTableStyle("Light List - Accent 4", false); for (int i = 0; i &lt; 5; i++) { wrdRng.InsertBreak(Word.WdBreakType.wdLineBreak); } wrdRng.PasteExcelTable(true, true, false); wrdInlineShape.ConvertToShape(); } // quit the word </code></pre> <p>hi there if u have some more bueatifull code for above one please post it. </p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload