使用 VBA 创建 Powerpoint 幻灯片母版

发布于 2024-12-11 14:46:37 字数 318 浏览 0 评论 0原文

我目前正在尝试使用 VBA 创建 Powerpoint (2010) SLide Master,但遇到了一些挑战。

1) 是否可以为模板中的占位符分配名称,以便随后在演示文稿中可以通过该名称来寻址该对象?我尝试使用 <.Name="..."> 分配名称,但这似乎不起作用。基于这些布局的实际演示中的对象仍然具有随机的默认名称。

2) 如何为 CustomLayouts 指定名称?

3 如何加载一个真正空白的 SlideMaster/其中的 CustomLayouts?

PS:我不确定模板标签,还有其他模板吗?

I am currently trying to create a Powerpoint (2010) SLide Master with VBA and am running into some challenges.

1) Is it possible to assign names to the Placeholders in the Templates so that the object is addressable via this name in the presentation afterwards? I have tried to assign names with <.Name="..."> which doesn't seem to work. The objects in the actual presentation based on those Layouts still have random default names.

2) How do I assign names to CustomLayouts?

3 How do I load a really blank SlideMaster / the CustomLayouts within it?

PS: I am not sure about the templates tag, are those other templates?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

会傲 2024-12-18 14:46:37

是否可以为模板中的占位符分配名称,以便随后在演示文稿中通过该名称可寻址该对象?我尝试使用 <.Name="..."> 分配名称,但这似乎不起作用。基于这些布局的实际演示文稿中的对象仍然具有随机的默认名称。

换句话说,虽然您可以重命名主布局之一上的形状,但当您基于该布局创建幻灯片时,幻灯片上的形状仍然具有不同的名称?这就是 PPT 的工作原理。您想通过“预设”幻灯片上的形状名称来实现什么目的?也许还有另一种方式可以到达那里。

2) 如何为 CustomLayouts 指定名称?

手动:

查看|幻灯片母版
右键单击布局的缩略图,然后选择“

通过 VBA 重命名布局”,例如:更改第一个幻灯片母版中第一个布局的名称:

With ActivePresentation.Designs(1).SlideMaster
  .CustomLayouts(1).Name = "No longer named Title"
End With

3 如何加载一个真正空白的 SlideMaster/其中的 CustomLayouts?

我不明白这个问题。请更详细一点?

Is it possible to assign names to the Placeholders in the Templates so that the object is addressable via this name in the presentation afterwards? I have tried to assign names with <.Name="..."> which doesn't seem to work. The objects in the actual presentation based on those Layouts still have random default names.

In other words, though you can rename a shape on one of the master layouts, when you base a slide on that layout, the shapes on the slides still have different names? That's the way PPT works. What are you trying to accomplish by "pre-setting" the names of shapes on slides? Perhaps there's another way of getting there.

2) How do I assign names to CustomLayouts?

Manually:

View | Slide Master
Rightclick the layout's thumbnail and choose Rename Layout

Via VBA, ex: change the name of the first layout in the first slide master:

With ActivePresentation.Designs(1).SlideMaster
  .CustomLayouts(1).Name = "No longer named Title"
End With

3 How do I load a really blank SlideMaster / the CustomLayouts within it?

I don't understand the question. More detail, please?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文