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.

Microsoft 365 and Office Development Office JavaScript API
Microsoft 365 and Office Development Other
0 comments No comments
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.