Expose geometric shape type as a readable property for existing shapes in PowerPoint JavaScript API
Context
I am building a PowerPoint add-in focused on slide auditing and efficient object management. A key capability is to identify and batch-manage geometric shapes on a slide (for example, select all hexagons, delete all ovals, or convert all rectangles into callouts). The current PowerPoint JavaScript API supports setting a geometric shape type when creating a new shape, but it does not allow reading that geometric shape type from existing shapes.
Reference: PowerPoint.GeometricShapeType (Preview) documentation:
https://learn.microsoft.com/en-us/javascript/api/powerpoint/powerpoint.geometricshapetype?view=powerpoint-js-preview
Pain
It is not possible to determine the underlying geometric preset (rectangle, oval, hexagon, etc.) for an existing shape via Office.js. The API provides shape.type (for example, geometricShape), but not the actual GeometricShapeType value for shapes that already exist on the slide or are selected by the user.
As a result, common productivity workflows cannot be implemented reliably and efficiently, including:
- Select all hexagons on a slide
- Delete all ovals across selected slides
- Convert all rectangles into crosses
- Create consistent formatting rules based on shape geometry (for example, apply specific outlines to all diamonds)
Example
Imagine a slide containing multiple geometric shapes: rectangles, ovals, and hexagons. A user selects the slide and wants the add-in to:
- find all ovals and delete them, and
- find all rectangles and convert them to a cross shape.
With the current API, the add-in can only see that these objects are geometric shapes (shape.type === geometricShape). It cannot read whether an individual geometric shape is a rectangle, oval, hexagon, etc. The only workaround is to parse the underlying OOXML or apply unreliable heuristics, which is complex, error-prone, and not feasible for real-time interactions.
Request
Please expose the geometric preset type for existing shapes as a readable property in the PowerPoint JavaScript API. Concretely, one of the following (or similar) options would solve the problem:
- Add a readable property on Shape for geometric shapes, for example:
- shape.geometricShapeType: PowerPoint.GeometricShapeType (read-only, available when shape.type === geometricShape)
- Ensure it is loadable on collections, for example:
- shapes.load("items/type,items/geometricShapeType")
- Optionally provide convenience filtering APIs for performance and usability, for example:
- slide.shapes.getByGeometricShapeType(PowerPoint.GeometricShapeType.hexagon)
- or a filter method on collections
This would enable robust batch operations (select, delete, replace/transform) and significantly improve add-in capabilities for slide auditing and formatting enforcement without requiring OOXML parsing.