Get shape by ID

  • You can use a shape’s unique ShapeId to update or control that shape on a slide.

Finding the ID of a shape:

Unfortunately, PowerPoint does not display a shape’s ID in the user interface. There are two workarounds:

  • Programmatically:

    • using VBA or any library capable of reading PowerPoint XML (e.g., python-pptx).

  • Manually:

    • Rename the .pptx file to .zip.

    • Open the ZIP and navigate to ppt/slides/slideX.xml.

    • Inside, look for any <p:sp>, <p:pic>, or similar shape element.

    • Each shape contains a <p:cNvPr> tag, its id attribute represents the shape’s unique ID.

Reference: shapes

Download: input.zip | output.pptx


{
    "presentation": {
        "template": "template.pptx",
        "slides": [
            {
                "slide_index": 0,
                "shapes": [
                    {
                        "shapeId": 6,
                        "data": [
                            ["Q1", "Q2", "Q3", "Q4"],
                            ["Product A", "Product B", "Product C", "Product D"],
                            [45, 32, 20, 18],
                            [55, 40, 30, 22],
                            [60, 48, 36, 28],
                            [72, 55, 42, 35]
                        ]
                    }
                ]
            }
        ]
    }
}

Last updated

Was this helpful?