0
votes

I am attempting to alter some text which is on a layout that I will be using for a handful of slides. I will be creating the same pptx document for a number of different parties, and I would like to alter the text on the layout, depending on who the pptx is for.

I know it is possible to get the slide layouts as below. Is it possible to edit the shapes on the layout?

import pptx

prs = pptx.Presentation(importPath)

layouts = prs.slide_layouts
layout1 = layouts[0]

## Edit layout1's shapes here...
1

1 Answers

1
votes

A slide layout is a special variant of a slide, so it also has a .shapes property you can use to access the shapes on the layout. Many of these will be placeholders, but background shapes (such as text-boxes or pictures/logos) will be there too. Once accessed, those shapes are manipulated the same way as shapes on any other slide.