scanny / python-pptx

Create Open XML PowerPoint documents in Python
MIT License
2.35k stars 510 forks source link

AttributeError: 'Slides' object has no attribute 'slides' #826

Open razhakin opened 2 years ago

razhakin commented 2 years ago

Hi!

I've just started having an issue with the library when it comes to just accessing slides.

textbox = pres.slides[0].shapes.add_textbox(Cm(0), Cm(0), Cm(19.25), Cm(5.5))

It has been working perfectly fine, yet all of sudden starts returning an error:

textbox = pres.slides[0].shapes.add_textbox(Cm(0), Cm(0), Cm(19.25), Cm(5.5)) AttributeError: 'Slides' object has no attribute 'slides'

The presentation is instantiated with multiple slides as this point and has been working well in the past, the error just randomly arose. Thanks a lot!

MartinPacker commented 8 months ago

I suspect pres is not your Presentation object but a Slides object.