python-pptx icon indicating copy to clipboard operation
python-pptx copied to clipboard

Add textbox to layout

Open martisak opened this issue 9 months ago • 1 comments

Is there a way to add a textbox to a layout?

prs = Presentation("filename.pptx")
for layout in prs.slide_layouts:
        textbox = layout.shapes.add_textbox()

Gives me AttributeError: 'LayoutShapes' object has no attribute 'add_textbox'. I see that this method is available in _BaseGroupShapes but the LayoutShapes class inherits directly from _BaseShapes.

Thanks :)

martisak avatar Mar 05 '25 08:03 martisak

Related? https://github.com/scanny/python-pptx/issues/824

martisak avatar Mar 05 '25 14:03 martisak