Starting a slideshow at a slide other than the first

R

RodneyB

In PowerPoint, the user can select any slide and start the slideshow starting
at that slide. With the 'loop continuously until "Esc"' checkbox ticked, and
slides advancing using time, the slideshow eventually loops back to slide #1
-not the slide that was selected before the start. Eg. if a presentation has
5 slides and the user selects #3 and starts the slideshow, the slides would
progress as follows;
3, 4, 5, 1, 2, 3, 4, 5,...

I simply want to do this programatically but have not had any success. I
have tried many things including setting
PowerPointPresentation.SlideShowSettings.RangeType = ppShowSlideRange;
PowerPointPresentation.SlideShowSettings.StartingSlide = 3;
but the result is that the SlideShow loops back to slide 3, not 1
eg. 3, 4, 5, 3, 4, 5,...
Do you have a code snippet that shows how it is done?

Thanks!
 
R

RodneyB

And the answer is....
//////// My code in Delphi...(uses timings and loop until 'esc' if checked
in PPT file)
procedure TfmPowerPointSlideShow.bnPlayClick(Sender: TObject);
var
i: integer;
vInt: integer;
vMySlides: OleVariant;
begin
// construct slide order
vMySlides := VarArrayCreate([0, 99], varInteger);
for i := fPowerPointSlideNum to fPowerPointPresentation.Slides.Count - 1 do
vMySlides[i - fPowerPointSlideNum] :=
fPowerPointPresentation.Slides.Item(i).SlideID;
for i := 1 to fPowerPointSlideNum - 1 do
vMySlides[fPowerPointPresentation.Slides.Count - 1 + i] :=
fPowerPointPresentation.Slides.Item(i).SlideID;
fPowerPointPresentation.SlideShowSettings.RangeType := ppShowNamedSlideShow;
fPowerPointPresentation.SlideShowSettings.NamedSlideShows.Add('MyShow',
vMySlides);
fPowerPointPresentation.SlideShowSettings.SlideShowName := 'MyShow';
// run show
fSlideShowWindow := fPowerPointPresentation.SlideShowSettings.Run;
SetWindowPos(Handle, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE OR
SWP_NOACTIVATE OR SWP_NOSIZE); // bring PPoint window back up
end;
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top