开发者

PowerPoint vba - For each shape in each Layout in MasterView

开发者 https://www.devze.com 2023-02-02 03:13 出处:网络
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

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 eac开发者_运维问答h 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


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


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
0

精彩评论

暂无评论...
验证码 换一张
取 消