PowerPoint vba - 对于 MasterView 中每个布局中的每个形状

发布于 2024-10-10 03:47:34 字数 609 浏览 0 评论 0原文

我正在尝试以编程方式更改 PowerPoint 模板中每个自定义布局中每个形状的语言,但我不知道如何执行此操作。我以前做过,但我找不到宏了,所以我真的不知道我是怎么做到的。不过,我已经能够选择每个自定义布局。但我需要循环遍历每个布局中的每个文本框并选择语言。我的问题是针对每个形状。我该怎么做?

这就是我到目前为止所得到的:

ActiveWindow.ViewType = ppViewSlideMaster

For Each oLayout In ActivePresentation.SlideMaster.CustomLayouts
    oLayout.Select
Next   

这基本上循环遍历每个布局。但我不知道如何选择每个占位符?我该怎么做?

编辑:现在的分辨率是:

For Each oLayout In ActivePresentation.SlideMaster.CustomLayouts
    oLayout.Select
    Dim oShape As Shape
    For Each oShape In oLayout.Shapes
        oShape.Select
    Next
Next

I'm trying to programatically change the language of each shape in each customlayout in a PowerPoint template and I can't figure out how to do this. I've done it before, but I can't find the macro anymore so I don't really know how I did it. I've been able to select each custom layout though. But I need to loop through each textbox in each layout and select the language as well. My problem is targetting each shape. How do I do this?

This is what I've got so far:

ActiveWindow.ViewType = ppViewSlideMaster

For Each oLayout In ActivePresentation.SlideMaster.CustomLayouts
    oLayout.Select
Next   

This basically loops through each layout. But I can't figure out how to select each placeholder? How do I do this?

Edit: Resolution is now:

For Each oLayout In ActivePresentation.SlideMaster.CustomLayouts
    oLayout.Select
    Dim oShape As Shape
    For Each oShape In oLayout.Shapes
        oShape.Select
    Next
Next

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

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

发布评论

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

评论(2

∞觅青森が 2024-10-17 03:47:34

循环遍历oLayout.Shapes,或者可能是oLayout.Shapes.Placeholders

Loop through oLayout.Shapes, or perhaps oLayout.Shapes.Placeholders.

挖个坑埋了你 2024-10-17 03:47:34

谢谢你们两位。我需要一个解决方案来更新主幻灯片上嵌入的 Excel 对象。
这让我找到了完美的解决方案

'loops through all shapes in slidemaster
    Dim oShape As Shape
    For Each oShape In ActivePresentation.SlideMaster.Shapes
        oShape.Select
        'checks for excel object (type=7)
                 If oShape.Type = msoEmbeddedOLEObject Then
                    oShape.OLEFormat.Activate

                    ActiveWindow.Selection.Unselect  'deactivates shape
                End If
    Next

Thanks you two. I needed a solution to updating an embedded Excel object on the master slide.
This lead me to the perfect solution

'loops through all shapes in slidemaster
    Dim oShape As Shape
    For Each oShape In ActivePresentation.SlideMaster.Shapes
        oShape.Select
        'checks for excel object (type=7)
                 If oShape.Type = msoEmbeddedOLEObject Then
                    oShape.OLEFormat.Activate

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