public override IExcelObj <ChartType> Copy(IExcelSheet Target) { PackShape.Copy(); var NewChart = Target.To <ExcelSheetMicrosoft>().PackSheet.Shapes.AddChart2(); NewChart.Chart.Paste(); NewChart.Chart.ChartType = PackShape.Chart.ChartType; return((IExcelObj <ChartType>)NewChart.ToChart(Sheet)); }
public override IWordParagraphObj <ChartType> Copy(IWordDocument Target, Index?Pos = null) { var Doc = Target.To <WordDocumentMicrosoft>(); var Index = Doc.ToUnderlying(Doc.ToIndexActual(Pos), false); var PackDoc = Doc.PackDocument; var NewChart = PackDoc.InlineShapes.AddChart2(Range: PackDoc.Range(Index)); PackShape.Copy(); NewChart.Chart.Paste(); NewChart.Chart.ChartType = PackShape.Chart.ChartType.To <Microsoft.Office.Core.XlChartType>(); return((IWordParagraphObj <ChartType>)NewChart.ToChart(Doc)); }