ConvertToBuildLevel

J

Jim Gordon MVP

Now it's my turn to ask a question :)

Has anyone had success getting ConvertToBuildLevel to work?

The sample below presumes a presentation with a picture object on the active
slide. When I run the code I get an error "object required" for the line
that sets eConv

Any suggestions? I want to add an animation and have only one animation on
the shape object when it's done. PowerPoint help leads me to believe that
ConvertToBuildLevel ought to let me set the animation to the first in the
list.

Sub ResetAnimations()
Dim MySlide As Slide
Dim s As Shape
Dim e1 As Effect
Dim eConv As Effect
Dim effectID As Integer
Let effectID = 4
Set MySlide = ActiveWindow.View.Slide
Set s = MySlide.Shapes(1)
Set e1 = MySlide.TimeLine.MainSequence.AddEffect(s, effectID)
Set eConv =
MySlide.TimeLine.MainSequence.ConvertToBuildLevel(Effect:=effFirst,
Level:=msoAnimateTextByFirstLevel)
End Sub

Any suggestions you can offer will be appreciated. Thanks.

-Jim
--
Jim Gordon
Mac MVP

MVPs are not Microsoft Employees
MVP info
 
S

Shyam Pillai

Jim,
First the obvious error:
Set eConv =
MySlide.TimeLine.MainSequence.ConvertToBuildLevel(Effect:=effFirst, _
Level:=msoAnimateTextByFirstLevel)

Change Effect:=effFirst to Effect:=e1. You are setting reference to a no
existent object.

Second ConverToBuildLevel is applicable to Shapes with text frame, charts
and diagrams. It will fail with everything else.
 
J

Jim Gordon MVP

Hi Shyam,

Thank you for the keen-eyed observations.

As it turns out, I can use the change effect example from PPT (win) help
file to prevent the addition of new effects onto an existing object.

However, I could not find an example of how to count the number of existing
effects already on an object. If I try to change an effect on an object that
has no effects then VBA responds with "The sequence collection is empty."
I'm hoping there is simple code to determine whether or not the sequence
collection is empty. I tried a few things, but could not hit on the right
syntax.

-Jim

--
Jim Gordon
Mac MVP

MVPs are not Microsoft Employees
MVP info
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top