0

PPT2010でcharのシリーズを取得する正しい方法は何ですか。

私は試した

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最初の方法でメソッドを呼び出し、2番目の方法でキャストする必要があります。

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