我可以将PowerPoint导出为JPG格式的文件,但无法使用表格进行此操作,据我所知,仍然是一张表格应该能够输出的“形状”。如何从Powerpoint以JPG格式导出表格(形状)
这是我用来将图表导出为JPG格式的代码的清理版本。
Const imgFilePath as String = "ChartImage.JPG"
Sub ExportChartJPG()
Dim cht as Variant 'this will hold the Chart/Shape object
Set cht = ActivePresentation.Slides(1).Shapes("Chart1").Chart
On Error Resume Next
Kill imgPath
On Error GoTo 0
cht.Export imgPath, "JPG"
End Sub
我想这将是简单的修改,如:
Sub ExportChartJPG()
Dim cht as Variant 'this will hold the Chart/Shape object
Set cht = ActivePresentation.Slides(1).Shapes("Table1").Table
On Error Resume Next
Kill imgPath
On Error GoTo 0
cht.Export imgPath, "JPG"
End Sub
但这抛出一个错误13
不匹配。
我也尝试将尺寸设置为cht
而不是Variant,并且设置cht = ActivePresentation.Slides(1).Shapes("Table1")
也失败。
优秀!这么简单:)为你+1 ... – 2013-03-21 20:04:15
从简要阅读PDF中,我认为我可以通过一些额外的参数来重新调整导出图像的大小,但现在,这绝对是我希望找到的方法。 – 2013-03-21 20:08:54