Reputation: 454
I am playing around with using win32com to create power points programmatically. I have a issue when snooping around in the slide master.
Open a power point, go to
Home -> Editing -> Select -> Selection Pane
Then do
View -> Slide Master
I deleted all the contents of layout 1 and inserted a picture placeholder as shown below
import win32com.client
pp = win32com.client.Dispatch("PowerPoint.Application")
pres = pp.Presentations.Open("<your pptx file name>.pptx")
design = pres.Designs
design = pres.Designs(1)
master = design.SlideMaster
layouts = master.CustomLayouts
>>> layouts(1).shapes(1).Type
14
>>> layouts(1).shapes(1).Name
'Picture Placeholder 7
My issue is that the Type enumeration, which I reference here, 14 is for ppPlaceholderHeader. Why is it not ppPlaceholderPicture? I.e. a Type of 18.
Perhaps I am navigating incorrectly and looking at wrong objects?
Upvotes: 0
Views: 341
Reputation: 14809
ALL placeholders are Type 14 objects. If you want to know the type of placeholder, use:
.PlaceholderFormat.Type
Upvotes: 1