If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
how do I run slideshow with animation ON
Hello,
I'd like to run PowerPoint slideshow with animation ON in my automation code. I'd like to move the animation one by one, since I'd like take a screen shot one by one. Environment: • Visual Studio 2008 (using PIA (Microsoft.Office.Interop.PowerPoint)) • Office2007 • C# Now I can run slideshow and move one slide to next slide with Animation OFF. But it will be crashed if I replace false to True as follows. // objSSS.ShowWithAnimation = Microsoft.Office.Core.MsoTriState.msoFalse; objSSS.ShowWithAnimation = Microsoft.Office.Core.MsoTriState.msoTrue; How can I move animation one by one in slideshow? And how can I count animation count? I'd like to know how many times I should loop. My current code is as follows: int nSlides = objPres.Slides.Count; objSSS = objPres.SlideShowSettings; Animation objSSS.ShowWithAnimation = Microsoft.Office.Core.MsoTriState.msoTrue; //Replaced with the following line -- And crash //Animation objSSS.ShowWithAnimation = Microsoft.Office.Core.MsoTriState.msoFalse; objSSS.RangeType = Microsoft.Office.Interop.PowerPoint.PpSlideShowRan geType.ppShowAll; objSSS.ShowType = Microsoft.Office.Interop.PowerPoint.PpSlideShowTyp e.ppShowTypeSpeaker; objSSS.LoopUntilStopped = Microsoft.Office.Core.MsoTriState.msoFalse; objSSS.AdvanceMode = Microsoft.Office.Interop.PowerPoint.PpSlideShowAdv anceMode.ppSlideShowManualAdvance; objSlides = objPres.Slides; int[] SlideIdx = new int[nSlides]; for (int ii = 0; ii nSlides; ii++) { SlideIdx[ii] = ii + 1; } objSldRng = objSlides.Range(SlideIdx); objSST = objSldRng.SlideShowTransition; objSST.AdvanceOnTime = Microsoft.Office.Core.MsoTriState.msoFalse; objSST.EntryEffect = Microsoft.Office.Interop.PowerPoint.PpEntryEffect. ppEffectNone; objSST.Hidden = MsoTriState.msoFalse; objSSW = objSSS.Run(); objSSWs = PowerpointApplication.SlideShowWindows; for (int isl = 1; isl = nSlides; isl++) { // Snip Capture screenshot code //move to next slide (I'd like to move to next animation) objSSWs[1].View.Next(); } } Thanks in advance. |
Thread Tools | |
Display Modes | |
|
|