How to add text placeholder to slide layout using javascript / powerpoint Api?

Nambi Nagarajan 0 Reputation points
2024-02-05T09:10:34.89+00:00

[image 1]
User's image

I know we can add shapes and textbox to it, like below
`
[code 1]

layout.shapes.addTextBox(`{{${layout.name}}}`, {
            left: 100,
            top: 50,
            width: 200,
            height: 100
          })

`
or
by doing this [image 2]
User's image

In the Office JavaScript API (Script Lab), I want to add a text placeholder directly to a slide layout[image 1]. While I know how to add shapes and text boxes like [image 2]/[code 1],

But the behavior of shape text boxes and placeholder text boxes seems to differ when it comes to slide generation. Shapes added as text boxes are treated as background images, and I can't get hold of them in slides, unlike placeholders. I wonder if there is any API support to directly add a placeholder instead of adding text through shapes. Thanks for any help provided.

JavaScript API
JavaScript API
An Office service that supports add-ins to interact with objects in Office client applications.
825 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,286 questions
0 comments No comments
{count} votes