Powerpoint - Text Changed Using VBA Reverts During

2019-08-11 07:38发布

问题:

I have some VBA in a Powerpoint presentation. It changes the text of a slide after the slide has transitioned.

The presentation is on a loop.

The problem I have is that after the change, during the transition effect on subsequent loops the text momentarily reverts back to its value before it was changed, only to flick back again after the transition.

Dim bChanged As Boolean
Public Sub OnSlideShowPageChange(ByVal Wn As SlideShowWindow)
    If Wn.View.CurrentShowPosition = 2 Then
        If bChanged = False Then
            ActivePresentation.Slides(2).Shapes("Header").TextFrame.TextRange.Text = "Changed"
            bChanged = True
        End If
   End If
End Sub