View Single Post
 
Old 07-13-2022, 03:45 AM
JohnWilson JohnWilson is offline Windows 10 Office 2019
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,912
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

Just to check the "Answers" are separate paragraphs in one textbox / placeholder?

Assuming you have used the Timeline object to create the animations you can remove animation on a paragraph by looping back through the mainsequence and deleting if they are not the answer.

Ideas for code (will need work) NOte there should be no existing animations otherwise you will need to do some math to work out which is the answer!

!

Code:
Dim osld As Slide
Dim oeff As Effect
Dim counter  As Long
Dim oshp As Shape
Dim ans As Long 'paragraph with answer
ans = 3 'for example
Set osld = ActiveWindow.View.Slide
Set oshp = osld.Shapes(2)
Set oeff = osld.TimeLine.MainSequence.AddEffect(oshp, msoAnimEffectBrushOnColor, msoAnimateTextByFirstLevel, msoAnimTriggerOnPageClick)
For counter = 4 To 1 Step -1
If Not counter = ans Then osld.TimeLine.MainSequence(counter).Delete
Next
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote