Results 1 to 3 of 3

Thread: Replace audio file in powerpoint

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #3
    Banned VBAX Regular
    Joined
    Sep 2020
    Posts
    15
    Location
    Thanks sir for your reply.

    I am using one animation on a shape(graphic) like

    Set gshp = osld.Shapes("graphic" & j)
    If gshp Is Nothing Then GoTo err
    gshp.PickupAnimation
    gshp.PickUp
    ' Capture properties of exisitng graphic such as location and size
    With gshp
        t = .Top
        l = .Left
        h = .Height
        w = .Width
    End With
    Set graphicShp = osld.Shapes.AddShape(gshp.AutoShapeType, l, t, w, h)
    If gshp.HasTextFrame Then
        graphicShp.TextFrame.TextRange = gshp.TextFrame.TextRange
    End If
    graphicShp.Apply
    graphicShp.ApplyAnimation
    Set oeff = osld.TimeLine.MainSequence.FindFirstAnimationFor(graphicShp)
    oeff.Timing.TriggerDelayTime = (j - 4) * 4.5
    oeff.Timing.TriggerType = msoAnimTriggerWithPrevious
    graphicShp.Name = "graphic" & j + 1
    And another animation I used on rectangle shape
    Set rshp = osld.Shapes("rectangle5")
    rshp.PickupAnimation
    rshp.PickUp
    ' Capture properties of exisitng rectangle5 such as location and size
    With rshp
        t = .Top
        l = .Left
        h = .Height
        w = .Width
    End With
    Set rectShp = osld.Shapes.AddShape(rshp.AutoShapeType, l, t, w, h)
    If hshp.HasTextFrame Then
        rectShp.TextFrame.TextRange =rshp.TextFrame.TextRange
    End If
    rectShp.Apply
    rectShp.ApplyAnimation
    For P = 1 To osld.TimeLine.MainSequence.Count
        If osld.TimeLine.MainSequence(P).Shape.Id = rectShp.Id Then
            X = X + 1
            Set oeff = osld.TimeLine.MainSequence(P)
            Select Case X
                Case Is = 1
                    oeff.Timing.TriggerType = msoAnimTriggerWithPrevious
                    oeff.Timing.TriggerDelayTime = (j - 4) * 4.5 + 1.9
                Case Is = 2
                   oeff.Timing.TriggerType = msoAnimTriggerWithPrevious
                   oeff.Timing.TriggerDelayTime = (j - 4) * 4.5 + 1.9
                Case Is = 3
                   oeff.Timing.TriggerType = msoAnimTriggerWithPrevious
                   oeff.Timing.TriggerDelayTime = (j - 4) * 4.5 + 5
                Case Is = 4
                   oeff.Timing.TriggerType = msoAnimTriggerWithPrevious
                   oeff.Timing.TriggerDelayTime = (j - 4) * 4.5 + 2.2
             End Select
             oeff.Timing.TriggerType = msoAnimTriggerWithPrevious
            rectShp.Name = "rectangle" & j + 1
        End If
    Next P
     X = 0
    Next j
    I lost graphic shape animation completely.
    & for rectangle shape only first animation(ie entrance appaer type animation) works(out of 4).
    I do not want to change above code which is working fine so want to change replace audio code only.
    Last edited by Aussiebear; 05-16-2025 at 12:55 PM. Reason: Added CODE tags again

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •