Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 07-13-2022, 03:45 AM
JohnWilson JohnWilson is offline Using VBA can I animate some text in a text box? Windows 10 Using VBA can I animate some text in a text box? Office 2019
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,914
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
 

Tags
animation vba powerpoint



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do animate so: click on an image, then a larger image appears, then click again & text overlaid? ship69 PowerPoint 1 09-30-2019 04:38 PM
How do I animate so: small image ==> large image ==> text over overlaid ==> back to next image ship69 PowerPoint 0 09-27-2019 12:55 PM
How to animate text? Salsa PowerPoint 3 01-13-2016 09:05 AM
Animate a part of an equation or text shahriar PowerPoint 1 09-20-2014 06:42 AM
Using VBA can I animate some text in a text box? Animate text to bold then animate text to regular? seanspotatobusiness PowerPoint 2 01-13-2011 12:08 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:06 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft