Animating Various shapes.

T

technoknight

I m working on Powerpoint Automation. I have to add few text boxes and put a
rectangle behind each of them I have been able to create the text boxes and
rectangles. I want the text box and its corresponding to get animated at the
same time. If there is only one rectangles and text box....then it will work.
But then I add the next textbox and rectangle, the newer rectangle gets
msoanimtriggerwithprevious and the previous rectangle gets
msoanimtriggerafterprevious, whereas it had msoanimtriggerwithprevious. I m
not sure why the trigger for previous rectangle changes from
msoanimtriggerwithprevious to msoanimtriggerafterprevious when the next
rectangles is added.
I m using code like the following code to add simultaneous animation to
textboxe and its rectangle:

' ---------------------------------------------------------------
Sub CreateAnimation()
Dim oEffect As Effect
Dim oShpA As Shape
Dim oShpB As Shape
With ActivePresentation.Slides(1)
Set oShpA = .Shapes.AddShape(msoShapeRectangle, 100, 100, 100, 100)
Set oShpB = .Shapes.AddTextbox(msoTextOrientationHorizontal, 300, 100,
100, 100)
oShpB.TextFrame.TextRange.Text = "This is an example."
With .TimeLine.MainSequence
' Fly in on mouse click for the rectangle.
Set oEffect = .AddEffect(Shape:=oShpA, _
effectId:=msoAnimEffectFly, _
trigger:=msoAnimTriggerOnPageClick)
' Fade zoom animation on the textbox at the same time.
Set oEffect = .AddEffect(Shape:=oShpB, _
effectId:=msoAnimEffectFadedZoom, _
trigger:=msoAnimTriggerWithPrevious)
End With
End With
End Sub
' ---------------------------------------------------------------

This code was provided by My.Shyam Pillai. My problem is only that when i
add the next rectangle the previously added rectangle's trigger changes to
msoAnimTriggerafterprevious.

Can anyone help me?

Thanks.
 
S

Shyam Pillai

I m using code like the following code to add simultaneous animation to
textboxe and its rectangle:

You might have a wrong reference in the code. I cannot reproduce what you
say. Unless you post your code there is no way I can help you further. I
would recommend that you stay with the relevant rather than start a new
thread.
 

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