Rabu, 20 November 2024

Get The Shape Position In Microsoft PowerPoint

  1. Type this following Microsoft Office PowerPoint VBA or macro in PowerPoint VBA Editor:
  2. 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
  3. Run the above VBA code by click Run > Run Sub/User Form menu.

Related Post


Tidak ada komentar:

Posting Komentar

Various Other Posts