【问题标题】:Powerpoint Modify Chart Legend widthPowerpoint 修改图表图例宽度
【发布时间】:2013-02-17 11:35:37
【问题描述】:

我正在使用 VB.net 在 Powerpoint 中创建图表并且有一个小问题:客户希望图例大于原始设计。 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

但我找不到宽度属性 - 就像任何正常的形状一样。

你有什么想法吗?

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

Argh:我需要更多的茶。我刚刚意识到 Office 2010 有一个 width 属性,而 2007 没有。所以我只需要检查 powerpoint 版本...哦,天哪...

【问题讨论】:

  • 这不再是一个问题了吗?如果有,您可以添加自己的答案。
  • +1 到@Remou - 麻烦一解决就提交您自己的答案。

标签: vb.net excel interop powerpoint


【解决方案1】:

Powerpoint 2010 及更高版本有一个 width 属性,所以它可以在那里工作。 width 和 left 属性有些奇怪,它们似乎与图表有关。所以期待一些实验。

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-01-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多