I am writing a code to find out the number of placeholders present in an existing PowerPoint presentation. But for some reason i am unable to load the side values to shape. I am missing something here. Could someone guide me?
I read the documentation and i see that most examples add a line
slide=prs.slides.add_slide(prs.slide_layouts[8])
I don't want to change my existing slide layout to slide_layouts style[8]
.
from pptx import Presentation
from pptx.util import Inches, Pt
from pptx.util import Inches
from pptx.enum.text import MSO_ANCHOR, MSO_AUTO_SIZE
prs = Presentation('test1.pptx')
slide = prs.slide_layouts(prs)
for shape in slide.placeholders:
print('%d %s' % (shape.placeholder_format.idx, shape.name))