0

在PPT 2010中获取字符系列的正确方法是什么。

我试过了

PowerPoint.SeriesCollection mySeriesCollection = (PowerPoint.SeriesCollection)
                                                           myChart.SeriesCollection(1);

引发以下异常

Exception Type:        System.InvalidCastException

此外,在 C# 中获取图表系列的正确调用是什么?

如果我尝试这种方式:

PowerPoint.Series mySeries = (PowerPoint.Series)myChart.SeriesCollection.Item(1);

我收到以下编译错误:

error CS0119: 'Microsoft.Office.Interop.PowerPoint.Chart.SeriesCollection(object)'
is a 'method', which is not valid in the given context
4

1 回答 1

0

你很近;您需要以SeriesCollection第一种方式调用该方法,并以第二种方式进行转换。

PowerPoint.Series mySeries = (PowerPoint.Series)myChart.SeriesCollection(1);
于 2012-12-11T23:01:25.373 回答