I am trying to add a title to my slide . I was looking up the documentation here and it says, "Setting the slide title Almost all slide layouts have a title placeholder, which any slide based on the layout inherits when the layout is applied. Accessing a slide’s title is a common operation and there’s a dedicated attribute on the shape tree for it:
title_placeholder = slide.shapes.title
title_placeholder.text = 'Air-speed Velocity of Unladen Swallows'
"
Actually my slide layout does not have a title_placeholder.
I ran this code to find out which placeholders I have :
for shape in slide.placeholders:
... print('%d %s' % (shape.placeholder_format.idx, shape.name))
and got:
11 Text Placeholder 3
12 Text Placeholder 4
13 Text Placeholder 2
15 Text Placeholder 1
So Now I'd like to add text to these placeholders - one of them is the Title - I'll figure out which one.
The documentation has how to insert table, picture and chart in a placeholder using insert_picture
, insert_table
etc. But no insert_text
.
How do I add text?