PDA

View Full Version : [SOLVED:] Hide/Reveal specific slide content during presentation mode



davidolone
08-15-2023, 06:21 AM
Hello, I am using PowerPoint to present product roadmaps.

There is both high level and low level content on the roadmap, calling out major milestones and interim milestones respectively.

For some audiences it is sufficient to show the high level content so I would like to hide the low level content for some presentations. However, in some cases, if the audience has a question to the low level content or if I have an audience where I need to present the low level content, I would like to be able to temporarily reveal it to support my answer. In my mind I am picturing a hide/show toggle that I could select on the slide to hide/show the content. Ideally the toggle needs to be available and work during presentation mode.

The content I have to hide/show is a mixture of text, text boxes, and shapes.

Ideally all content should be on one slide to keep administrative maintenance of the roadmap to a minimum.

Is VBA the correct approach to solve this and do you have some guidance on how to implement?

Aussiebear
08-15-2023, 11:18 AM
Have a look here to see if this has some content of interest. PowerPoint offers you the chance to hide or unhide slides. https://support.microsoft.com/en-gb/office/hide-or-show-a-slide-8313e1ec-3e20-4464-952f-387931554d69

davidolone
08-15-2023, 11:52 AM
Have a look here to see if this has some content of interest. PowerPoint offers you the chance to hide or unhide slides. https://support.microsoft.com/en-gb/office/hide-or-show-a-slide-8313e1ec-3e20-4464-952f-387931554d69

Hiding and showing a complete slide is not the request.
Im trying to hide/show specific content on a slide.

John Wilson
08-15-2023, 12:29 PM
Could you not just use triggered animation?

Aussiebear
08-15-2023, 02:05 PM
There's a hundred ways to skin a cat..... and so it is with slides with different levels of content. If you believe the audience is more suitable for High content then only show the high content, else if the audience asks a question that requires additional information (Low) then replace (Hide Unhide) the slide (Low for High).

Paul_Hossler
08-15-2023, 02:42 PM
This is pretty crude and quick

You need VBA to add a tag to a shape, since you can't do it from the UI so select a shape and run SetTag

To flip the visibility of the shape, FlipTags reverses the state. There's also a ShowAll and a HideAll macro



Option Explicit


'https://learn.microsoft.com/en-us/office/dev/add-ins/powerpoint/tagging-presentations-slides-shapes


Sub SetTag()
Call ActiveWindow.Selection.ShapeRange.Tags.Add("admin", "yes")
End Sub


Sub FlipTags()
Dim oSlide As Slide
Dim oShape As Shape

For Each oSlide In ActivePresentation.Slides
For Each oShape In oSlide.Shapes
If oShape.Tags.Item("admin") = "yes" Then oShape.Visible = Not oShape.Visible
Next
Next
End Sub



Sub ShowAll()
Dim oSlide As Slide
Dim oShape As Shape

For Each oSlide In ActivePresentation.Slides
For Each oShape In oSlide.Shapes
If oShape.Tags.Item("admin") = "yes" Then oShape.Visible = msoTrue
Next
Next
End Sub


Sub HideAll()
Dim oSlide As Slide
Dim oShape As Shape

For Each oSlide In ActivePresentation.Slides
For Each oShape In oSlide.Shapes
If oShape.Tags.Item("admin") = "yes" Then oShape.Visible = msoFalse
Next
Next
End Sub

If you really want to get fancy, you can make this selectively show/hide macros, add a macro button to a slide to only flip on that slide, etc.

davidolone
08-16-2023, 08:31 AM
Could you not just use triggered animation?

Just played around with this and indeed using a trigger to start the animation works quite well to make the hidden objects visible on demand.
Am I right in saying that the trigger can only progress the animation though?

For example, if I make the hidden objects visible using the trigger, is there a way to “reset” the animation (so the objects are hidden) using another trigger for example?

UPDATE:
All sorted, thanks! I just use "Add Animation" to toggle the content to non-visible again.

Thank you everyone for the input, this has been a big help!!

https://www.youtube.com/watch?v=XZ8pehMyXDY

John Wilson
08-16-2023, 01:14 PM
You're welcome!