From: Asian on
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.

• 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 =

objSSS.RangeType =
objSSS.ShowType =
objSSS.LoopUntilStopped = Microsoft.Office.Core.MsoTriState.msoFalse;
objSSS.AdvanceMode =

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 =
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)

Thanks in advance.
Pages: 1
Prev: .wav file issue
Next: MS Power Point