vba, powerpoint example - each slide effect, each paragraph effect after click« Wróć do listy pytań

example code
Wysłane przez mrmucha
Zadane przez 09/10/2020 10:08
0

alt+f11, module

Dim oshp As Shape
Dim oslide As slide
       
Sub Format()

Dim tekst, slide, start_slide, end_slide

start_slide = 7
end_slide = 18

        For i = start_slide To end_slide
        
                Set slide = ActivePresentation.Slides(i)
                Set tekst = ActivePresentation.Slides(i).Shapes(2)
                
                If tekst.HasTextFrame Then
                        
                        'text align, vertical middle
                        With tekst.TextFrame
                          .VerticalAnchor = msoAnchorMiddle
                        End With

                        'text spacing/interline
                        With tekst.TextFrame.TextRange.ParagraphFormat
                            .LineRuleWithin = msoTrue
                            .SpaceWithin = 1.3
                        End With
                    
                        'position
                        With tekst
                            .Left = 80
                            .Top = 115
                            .Width = 550
                            .Height = 380
                        End With
                        

                        'cleanup old effects
                        For x = slide.TimeLine.MainSequence.Count To 1 Step -1
                                 slide.TimeLine.MainSequence.Item(x).Delete
                        Next x
                        
                       
                       'blinds effect for each paragraph
                        slide.TimeLine.MainSequence.AddEffect Shape:=tekst, effectid:=msoAnimEffectBlinds, Level:=msoAnimateTextByFirstLevel, trigger:=msoAnimTriggerOnPageClick
                        
                        For j = 1 To tekst.TextFrame.TextRange.Paragraphs.Count
                            Set eff = slide.TimeLine.MainSequence.Item(j)
                            eff.Timing.SmoothEnd = msoFalse
                            eff.Timing.Duration = 2.5
                        Next j
                End If
       Next i
       
       'each slide effect
       For i = start_slide To end_slide
            Set slide = ActivePresentation.Slides(i)
            slide.SlideShowTransition.EntryEffect = ppEffectCheckerboardAcross
        Next
       
 End Sub
Wysłane przez mrmucha
Odpowiedziane 09/10/2020 10:09