Powerpoint 2010 - VBA or .NET - Correct handler on slide display

Answered Powerpoint 2010 - VBA or .NET - Correct handler on slide display

すべての返信

  • 2012年4月11日 2:27
    モデレータ
     
     回答済み コードあり

    Hi Greg,

    Thanks for posting in the MSDN Forum.

    "Which is the one i want to be able to refresh images, excel chart links or web page references before the slide is displayed ? (no minimise flicker, and make the transition between slides as soon as possible)" I think I'm not very sure about your goal. I suppose you want to add some shape into the exists slides when it is going to be shown.

    This snippet is developed under Visual Studio 2010, PowerPoint 2010. It will add a label at the left top to show slide index automatically.

    Public Class ThisAddIn
        Private WithEvents PPApp As PowerPoint.Application
    
        Private Sub ThisAddIn_Startup() Handles Me.Startup
            PPApp = Application
        End Sub
    
        Private Sub ThisAddIn_Shutdown() Handles Me.Shutdown
    
        End Sub
    
        Private Sub PPApp_SlideShowNextSlide(ByVal Wn As  _
                                             PowerPoint.SlideShowWindow) _
                                         Handles PPApp.SlideShowNextSlide
            Dim slide As PowerPoint.Slide
            Dim shape As PowerPoint.Shape
    
            slide = Wn.View.Slide
            shape = slide.Shapes.AddLabel(Microsoft.Office.Core.MsoTextOrientation.msoTextOrientationHorizontal, 0, 0, 100, 100)
            shape.TextFrame.TextRange.Text = "This is page : " & CStr(slide.SlideIndex)
        End Sub
    
    End Class

    I hope it can help you.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

  • 2012年4月11日 11:05
     
     

    Thanks Tom

    More info - i used the term refresh because that is what i mean, e.g. whether it is an linked image, or linked excel chart, i want to refresh the content on display (by default, Powerpoint only does this on startup).

    If a presentation is in a loop and linked content changes, you want to be able to refresh what is displayed.

    I am going to assume from your reply that SlideShowNextSlide is the best option and better than SlideShowNextBuildEventHandler  for this purpose.

    THanks

  • 2012年4月12日 2:37
    モデレータ
     
     

    Hi Greg,

    I tried SlideShowNextBuildEventHandler before I post it. It seems not fire when you switch the slide. So I think SlideShowNextSlide will fit your goal.

    Have a good day,

    Tom


    Tom Xu [MSFT]
    MSDN Community Support | Feedback to us

  • 2012年4月12日 2:47
     
     

    Tom

    You are spot on, that is what i found about SlideShowNextBuildEventHandler  in  http://social.msdn.microsoft.com/Forums/en-US/officegeneral/thread/ecdd0b52-135d-4f8f-a0cd-ebdc9cb8168a 

    So perhaps things here changed on 2007 / 2010...