Powerpoint修改图表图例宽度

我正在使用VB.net在Powerpoint中创build图表并产生一个小问题:客户希望图例比原始devise更大。 Interop可以吗?

我基本上有这样的结构:

Dim TargetChartas Microsoft.Office.Interop.PowerPoint.Chart TargetChart.HasLegend=true With TargetChart.Legend .Position = Microsoft.Office.Interop.PowerPoint.XlLegendPosition.xlLegendPositionTop .Format.TextFrame2.TextRange.Font.Bold = Microsoft.Office.Core.MsoTriState.msoCTrue .Format.Line.Visible = Microsoft.Office.Core.MsoTriState.msoCTrue End Width 

但我无法find一个宽度属性 – 像任何正常的形状posess。

你有什么想法如何做到这一点?

我添加了Excel的标签,因为图表基本上是Excel图表。

阿格:我需要更多的茶。 我刚刚意识到Office 2010有一个宽度属性,而2007年没有。 所以我只需要检查一下PPT的版本哦哦

Powerpoint 2010和更高版本有一个宽度属性,所以它在那里工作。 宽度和左边的属性有点奇怪,它们似乎是相对于图表。 所以期待一些实验。

如果您必须支持Office 2007,则可以检查应用程序版本:Chart.application.version 14.0是Office 2010.我将其转换为数字,并检查它是否大于14。