Kur*_*eek 4 powerpoint vba powerpoint-vba
I currently have a PowerPoint macro which inserts a picture in the current slide with its original size:
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
Run Code Online (Sandbox Code Playgroud)
How do I 'get' the size of the image? I want to do something similar to what is described in
Powerpoint VBA Macro to copy object's size and location and paste to another object
but "ShapeRange" doesn't seem to be selectable for the object I created.
Try this one:
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
Run Code Online (Sandbox Code Playgroud)