所有幻灯片母版占位符默认为类型14

2024-05-14 15:45:04 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在用win32com编程创建powerpoints。我在幻灯片母版中四处窥探时遇到了问题。你知道吗

打开电源点,转到

主页->;编辑->;选择->;选择窗格

那就做吧

查看->;幻灯片母版

我删除了布局1的所有内容,并插入了一个图片占位符,如下所示

enter image description here

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

我的问题是类型枚举(我引用了here)14是用于ppPlaceholderHeader的。为什么不是照片?也就是说,一种18。你知道吗

也许我导航不正确,看错了东西?你知道吗


Tags: gtmasterclient编程ppwin32comdesignlayouts

热门问题