How to duplicate a slide or copy a PowerPoint shape from one slide to another using the PowerPoint API?

ThomasHumberset-7355 11 Reputation points
2023-01-02T08:22:37.57+00:00

I want to basically duplicate a slide, or at least copy certain shapes from one slide to another one using the PowerPoint API (not VBA), is this possible?

Since the shapes array is readonly it can not be manipulated. Is there another way of achieving this?

If possible, can you show an example of how it is done?
If not possible, is there a good reason why it's not possible, or is it just not implemented yet?

JavaScript API
JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
866 questions
Office Development
Office Development
Office: A suite of Microsoft productivity software that supports common business tasks, including word processing, email, presentations, and data management and analysis.Development: The process of researching, productizing, and refining new or existing technologies.
3,479 questions
0 comments No comments
{count} vote

1 answer

Sort by: Most helpful
  1. John Korchok 4,926 Reputation points
    2023-01-02T16:25:31.837+00:00

    An API is a set of specifications that outline how a programming language can interact with a program. It's not a programming language itself. You can program PowerPoint using VBA (through the VBA IDE built into the program), Visual Basic or C# (using Visual Studio), JavaScript (using Office.js), Python and others. All of these languages follow the PowerPoint API to manipulate the program.

    A shapes array is not read-only. You have to work with it using the ShapeRange object, which is a bit of a pain, but certainly possible.

    To provide code examples, you would have to specify the language you want to work with.