I have a PowerPoint presentation with 156 slides. On each slide I have text boxes and shapes that I used the Group feature to band together then I labeled the group in the selection pane. I gave each group of shapes the same name on each slide. Right now the groups are visible on all of the slides, but there will times when these groups need to be hidden. Rather than going into each slide and manually hiding these groups via the selection pane, is there VBA I can add that would hide or show these groups in the entire presentation at once?
Update - I now have code that successfully shows and hides the specified shape group on the first slide when I run it:
Sub Numbers()
For i = 1 To 2
ActivePresentation.Slides(i).Shapes("Shape Group").Visible = msoTriStateToggle
Next
End Sub
To make this loop through the rest of the presentation, I added the following code:
Sub Numbers()
Dim sld As Slide
For Each sld In ActivePresentation.Slides
For i = 1 To 2
ActivePresentation.Slides(i).Shapes("Shape Group").Visible =
msoTriStateToggle
Next
Next sld
End Sub
Now when I run this updated code, nothing happens. What's missing in this code?
question from:
https://stackoverflow.com/questions/66054741/powerpoint-hide-show-grouped-objects-in-entire-presentation 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…