是否可以通过编程方式,例如使用互操作.PowerPoint,或打开放在PowerPoint幻灯片上的图表的XML SDK、定义、启用/禁用状态数据标签复选框?
我试过用互操作.PowerPoint,如下面的代码所示,但我的代码不完整。有没有人对如何完成代码来完成我要完成的任务有什么想法,如上所述?
internal static void DataLabels()
{
var app = new PP.Application();
var pre = app.Presentations.Open2007(@"c:\input.pptx", WithWindow: MsoTriState.msoFalse, Untitled: MsoTriState.msoTrue);
var chartShape = pre.Slides[1].Shapes[1];
var chart = chartShape.Chart;
//...
// if chart has Data Labels set true write 'Yes' in console.
Console.WriteLine("Yes.");
}