Shape animations not working properly when Slideshow initiated by vb.net app.

Answered Shape animations not working properly when Slideshow initiated by vb.net app.

  • Friday, May 25, 2012 9:09 AM
     
     

    Hopefully I am not in the wrong forum for this but if so please let me know.   I have written a VB.Net app in Express 2010 on a Windows 7 desktop with MS Office 2007.   I am running an instance of PPT Slideshow from the app in a small window on the screen.   On my slides I have several large bullet points with custom animation for random entrances.   These work perfect when I initiate the slideshow through windows Powerpoint but when run from my program they behave in a spurious manner.  Most often only half of the animations will work properly while others simply do not appear and yet again others fly to the top left hand corner of the slide.   As these all work fine in Powerpoint run from windows why wont they work when Powerpoint is run from my VB program.   In both cases I am using the mouse to click on for the next event on the slides.   I assume it must be in the way I am calling PowerPoint SlideShow in my program or perhaps I am not using some important setting, so I have included my vb code below.   Also I do want to use the "View.GoToClick" method instead of the mouse but the objects then simply appear without any custom animation such as 'fly-in' or 'disolve-in' etc.

    I have searched high and low on the web for some clue to this but could find nothing so I would appreciate any help you can give me.   Many thanks in advance.

    Tom

    Imports PowerPoint = Microsoft.Office.Interop.PowerPoint

    Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

            RunPPSlideShow

    End Sub

    Private Sub RunPPSlideShow()

             Const PPShowTypeInWindow = 1

             Dim PP as PowerPoint.Application

             Dim Pres As PowerPoint.Presentation

             PP = CreateObject("Powerpoint.Application")

             PP = New PowerPoint.Application

            Pres = PP.Presentations.Open("C:\PPTDocs\PPTSlides.pptx", WithWindow:=False)

            Dim ShowSettings As PowerPoint.SlideShowSettings

            ShowSettings = Pres.SlideShowSettings

            With ShowSettings

                    .ShowType = PPShowTypeInWindow

                    .Run()

             End With

            With PP.SlideShowWindows(1)

                    .Height = 177

                    .Width = 235

                    .Top = 220

                    .Left = 869

                    .Activate()

             End With

            ShowSettings = Nothing

             Pres = Nothing

    End Sub

    End Class

    PS One interesting thing I tried was to close the Slideshow and reopen it again in the code by inserting these two lines after RunPPSlideShow in Button1_Click

    PP.SlideShowWindows(1).View.Exit()   'make PP a Public for this

    RunPPSlideSHow()

    When I did this the animations worked more successfully about 95% of the time.  But still not 100% working.

    Any Ideas or Help would be much appreciated.  

    Regards

    Tom

All Replies

  • Monday, May 28, 2012 4:11 AM
     
     

    Hi Tom,

    Since this is an Office deveplopment issue. In order to get the answer effectively, I'm moving this thread to the Office Development Forum for further discussion.
    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.

    Max Meng

    TechNet Community Support

  • Thursday, May 31, 2012 11:15 AM
     
     Answered

    Ok I have discovered that opening the slide show while setting .ShowType to ppShowTypeSpeaker instead of ppShowTypeInWindow fixes the probelm.   Also If I allow a Thread.Sleep in my application for a few secons following the Open statement then the SlideShow animations seem to work 100% of the time.    Many thanks.

    Tom

    • Marked As Answer by Tom EYT Thursday, May 31, 2012 11:15 AM
    •