我正在尝试在PowerPoint模板中以编程方式更改每个CustomLayout中每个形状的语言,但我无法弄清楚如何做到这一点。我以前做过,但是我再也找不到宏,所以我真的不知道我是怎么做到的。我已经能够选择每个自定义布局。但是我需要在每个布局中的每个文本框上循环并选择语言。我的问题是针对每种形状。我该怎么做呢?

这就是我到目前为止的一切:

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
有帮助吗?

解决方案

依次通过 oLayout.Shapes, , 也许 oLayout.Shapes.Placeholders.

其他提示

谢谢你们两个。我需要一个解决方案来更新主幻灯片上的嵌入式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
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top