如何使用vba在Powerpoint 2007中将图像宽高比设置为100%?

时间:2012-04-23 10:38:02

标签: vba powerpoint powerpoint-vba powerpoint-2007

我正在研究自动化工具。我想在每张幻灯片上将图像宽高比设置为100%。 在vba中是否有任何财产?

感谢Adv。

1 个答案:

答案 0 :(得分:2)

你的意思是这样吗?

Option Explicit

Sub Sample()
    Dim shp As Shape

    Set shp = ActivePresentation.Slides(1).Shapes("Picture 1")

    With shp
        .ScaleHeight 1, msoTrue
        .ScaleWidth 1, msoTrue
    End With
End Sub