所有幻灯片母版占位符默认为类型 14
All slide master placeholders default to type 14
我正在尝试使用 win32com 以编程方式创建电源点。在幻灯片母版中窥探时遇到问题。
打开电源点,转到
主页 -> 编辑 -> Select -> Selection 窗格
然后
查看 -> 幻灯片母版
我删除了布局1的所有内容,插入了一个图片占位符如下图
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
我的问题是我引用的 Type 枚举 here,14 用于 ppPlaceholderHeader。为什么不是 ppPlaceholderPicture? IE。类型 18.
也许我导航不正确,看错了对象?
所有占位符都是 Type 14 对象。如果您想知道占位符的类型,请使用:
.PlaceholderFormat.Type
我正在尝试使用 win32com 以编程方式创建电源点。在幻灯片母版中窥探时遇到问题。
打开电源点,转到
主页 -> 编辑 -> Select -> Selection 窗格
然后
查看 -> 幻灯片母版
我删除了布局1的所有内容,插入了一个图片占位符如下图
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
我的问题是我引用的 Type 枚举 here,14 用于 ppPlaceholderHeader。为什么不是 ppPlaceholderPicture? IE。类型 18.
也许我导航不正确,看错了对象?
所有占位符都是 Type 14 对象。如果您想知道占位符的类型,请使用:
.PlaceholderFormat.Type