Share via

Get coordinates of a shape in powerpoint

Anonymous
2013-01-15T01:26:27+00:00

Hi,

Is there anyway I can get the absolute position of a normal shape (e.g. a Rectangle) in powerpoint programmatically?

Thanks!

Microsoft 365 and Office | PowerPoint | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

12 answers

Sort by: Most helpful
  1. Steve Rindsberg 99,161 Reputation points MVP Volunteer Moderator
    2013-01-15T23:26:58+00:00

    Have a play with this:

    Dim oSh As Shape

    Set oSh = ActiveWindow.Selection.ShapeRange(1)

    Debug.Print ActiveWindow.PointsToScreenPixelsX(oSh.Left)

    Debug.Print ActiveWindow.PointsToScreenPixelsY(oSh.Top)

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2013-01-15T18:03:25+00:00

    Thanks for the reply. But I guess, I wan't clear while asking the question. The Top and Left return the position of the shape relative to the slide in Points. I want to know if there's a way to get the absolute screen coordinate in pixels of a simple shape like Rectangle. 

    Thanks!

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  3. Andreas Killer 144.1K Reputation points Volunteer Moderator
    2013-01-15T11:19:13+00:00

    Every shape has a Top and Left property that let you know where the shape is.

    Andreas.

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments
  4. Anonymous
    2013-01-16T07:27:36+00:00

    Hi,

    I have run into another problem. Although, the method described above work very well when in non-presentation mode, I can't seem to get the coordinates of a box in presentation mode. Is there a way to get the absolute coordinates of a shape, given its ID, in presentation mode?

    Thanks

    Was this answer helpful?

    0 comments No comments
  5. Anonymous
    2013-01-15T23:51:14+00:00

    Awesome. That works very well. Thanks a ton! :-)

    Best,

    Atul

    Was this answer helpful?

    0 comments No comments