- Type this following Microsoft Office PowerPoint VBA or macro in PowerPoint VBA Editor:
- Run the above VBA code by click Run > Run Sub/User Form menu.
Sub getShapePosition()
'-- Declare variables
Dim oPPApp As New PowerPoint.Application
Dim oShp As PowerPoint.Shape
'-- Set an object variable to shape that index is 1
Set oShp = oPPApp.ActivePresentation.Slides(oPPApp.ActiveWindow.Selection.SlideRange.SlideIndex).Shapes(1)
'-- Print out the Shape position on Immediate window
Debug.Print oShp.Left
Debug.Print oShp.Top
End Sub
Tidak ada komentar:
Posting Komentar