【问题标题】:Get the size of a picture获取图片大小
【发布时间】:2014-04-29 10:17:32
【问题描述】:

我目前有一个 PowerPoint 宏,它可以在当前幻灯片中插入原始大小的图片:

Sub Insert_Traverse_2()
    Dim oPic As Shape
    Set oPic = ActiveWindow.View.Slide.Shapes.AddPicture("\\nlamvfs00065\homes\nlkpec\newpic.png", False, True, 0, 0, -1, -1)
End Sub

如何“获取”图像的大小?我想做一些类似于

中描述的事情

Powerpoint VBA Macro to copy object's size and location and paste to another object

但我创建的对象似乎无法选择“ShapeRange”。

【问题讨论】:

    标签: vba powerpoint


    【解决方案1】:

    试试这个:

    Sub Insert_Traverse_2()
        Dim oPic As Shape
        Set oPic = ActiveWindow.View.Slide.Shapes.AddPicture("\\nlamvfs00065\homes\nlkpec\newpic.png", False, True, 0, 0, -1, -1)
        With oPic
            MsgBox .Width
            MsgBox .Height
            MsgBox .Left
            MsgBox .Top
        End With
    End Sub
    

    【讨论】:

    • 比我想象的要简单!感谢您的回答。
    猜你喜欢
    • 2011-01-03
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-09-20
    • 2014-02-14
    • 1970-01-01
    相关资源
    最近更新 更多