简体   繁体   English

如何通过VBA访问自定义布局幻灯片

[英]How to access custom Layout Slides through VBA

If I try to access custom layout slides, VBA error appears 如果我尝试访问自定义布局幻灯片,则会出现VBA错误

Following code shows error: 以下代码显示错误:

layout = ActivePresentation.SlideMaster.CustomLayouts(1)

How should I access custom layout slides? 我应该如何访问自定义布局幻灯片?

The Presentation object has a Designs collection (each Design is what we would have called a SmartMaster before). Presentation对象具有一个Designs集合(每个设计以前就是我们所说的SmartMaster)。

Each Design has a SmartMaster and the SmartMaster has a CustomLayouts collection that contains the layouts. 每个设计都有一个SmartMaster,而SmartMaster具有一个包含布局的CustomLayouts集合。 So: 所以:

Debug.Print ActivePresentation.Designs(1).SlideMaster.CustomLayouts(1).Name

That'll show you the name of the first layout (usually Title Slide) in the first master of the presentation. 这将为您显示演示文稿的第一个母版中第一个布局的名称(通常是Title Slide)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 VBA PowerPoint 幻灯片设置自定义布局以刷新布局 - VBA PowerPoint Slides set custom layout to refresh the layout 如何在MS Power Point演示文稿的一张主幻灯片中添加自定义文本占位符,并为每张幻灯片使用VBA脚本对其进行访问? - How to add a custom Text placeholder in one of the master slides in MS Power Point presentation and access it using VBA Script for each slide? VBA Powerpoint:循环并重命名所有幻灯片 - VBA Powerpoint: loop through and rename all the slides VBA不循环通过任何PowerPoint幻灯片 - VBA not looping through any PowerPoint slides Powerpoint VBA Loop不在所有幻灯片中循环播放 - Powerpoint VBA Loop not looping through all slides 在PowerPoint中使用VBA的幻灯片中使用了如何检测/查找特定布局的方法 - How to detect/find particular layout is used in which slides using VBA in powerpoint 从Access VBA填充Powerpoint幻灯片 - Populating Powerpoint slides from Access VBA 如何通过VBA使用Powerpoint模板来构建所需的幻灯片? - How do I use my powerpoint template through VBA in order to build my desired slides? 如何在ppt中选择具有相同自定义布局或包含给定形状或文本的幻灯片? - How to select slides in ppt which have the same custom layout, or contain a given shape or text? VBA代码删除带有空白布局PowerPoint的所有幻灯片? - Vba code to delete all slides with a blank layout powerpoint?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM