I have a program that creates a powerpoint presentation with a title slide and a number of slide that either have one picture/slide or 6/slide.I have figured out how to create the presentation and the slides with 1 picture. I can also create the slide with 6 placeholders and insert the first picture. I am however stuck on how to later reference one of the slides with 5 remaining placeholder and insert the coorect pictures as needed.
as of right now I have the a list of the slide with 5 placeholders remaining on them and can use a dictionary to tie the correct picture to the correct slide. i also have the pictures named such that I can tell which picture goes in which placeholder on the slide. I tired the following but got an error and can’t figure out what I have wrong.
”’
activeslide=prs.slides.get(slidenun)
ipic_ph1=activeslide.placeholders[phid]
iph_pic1=ipic_ph1.insert_picture(path+’/’+ip)
”’
where “slidenum” is the number of the slide where I want to place a picture, “phid” is the id of the place holder on the slide where I want the picture, and “path+’/’+ip” is the picture itself to be inserted. can anyone suggest why I am getting the following error
“ipic_ph1=activeslide.placeholders[phid] #define picture place holder for individual side to go into
^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: ‘NoneType’ object has no attribute ‘placeholders'”