scanny / python-pptx

Create Open XML PowerPoint documents in Python
MIT License
2.45k stars 528 forks source link

Accessing a Slide with index in a presentation #341

Closed thoramgowtham closed 6 years ago

thoramgowtham commented 6 years ago

Hi, I am trying to create thousands of powerpoint presentations using Powerpoint VBA. Few days back I have learned python is the better tool to solve my issues which VBA cannot solve. So I am learning python.pptx to create those presentation and I am doing fine. But I need to access some slides in powerpoint presentations and edit them according to my needs. If I can get access to a slide using index or in any other way I can easy handle the rest of my problems. I have browsed many web pages but found nothing on this issue. Can some one help me with this?

Thank you in advance.

scanny commented 6 years ago

Support questions like this are better taken up on StackOverflow (use the 'python-pptx' tab).

Here's a hint of how you'd do it:

prs = Presentation('my-presentation.pptx')
slide_1 = prs.slides[0]
slide_3 = prs.slides[2]
thoramgowtham commented 6 years ago

I apologize, But thank you very much for an immediate replay.

scanny commented 6 years ago

No worries @thoramgowtham :)