使用VBA创建Powerpoint幻灯片母版

时间:2022-12-31 13:00:00

I am currently trying to create a Powerpoint (2010) SLide Master with VBA and am running into some challenges, hope you can help me.

我目前正在尝试使用VBA创建一个Powerpoint(2010)SLide Master并遇到一些挑战,希望你能帮助我。

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.

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

2) How do I assign names to CustomLayouts?

2)如何为CustomLayouts指定名称?

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

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

Those are my most urgent challenges at the moment, hope one of you guys can help me. Thanks a lot seba

这些是我目前最紧迫的挑战,希望你们其中一个人可以帮助我。非常感谢seba

P.S.: I am not sure about the templates tag, are those other templates?

P.S。:我不确定模板标签,是那些其他模板?

1 个解决方案

#1


0  

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.

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

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.

换句话说,虽然您可以在其中一个主布局上重命名形状,但是当您在该布局上放置幻灯片时,幻灯片上的形状仍然具有不同的名称?这就是PPT的工作方式。您想通过“预先设置”幻灯片上的形状名称来实现什么目标?或许还有另一种方法可以实现目标。

2) How do I assign names to CustomLayouts?

2)如何为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:

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

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?

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

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

我不明白这个问题。更多细节,好吗?

#1


0  

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.

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

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.

换句话说,虽然您可以在其中一个主布局上重命名形状,但是当您在该布局上放置幻灯片时,幻灯片上的形状仍然具有不同的名称?这就是PPT的工作方式。您想通过“预先设置”幻灯片上的形状名称来实现什么目标?或许还有另一种方法可以实现目标。

2) How do I assign names to CustomLayouts?

2)如何为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:

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

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?

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

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

我不明白这个问题。更多细节,好吗?