Powerpoint - Current Slide

Add-in Express™ Support Service
That's what is more important than anything else

Powerpoint - Current Slide
identify the current slide 
Ralf Garbe




Posts: 20
Joined: 2014-11-22
Hello,
how could one identify the current slide in Powerpoint with Delphi?
I can manipulate a slide by assigning it to a PowerPointSlide object (slide: PowerPointSlide;)
slide := PowerPointApp.ActivePresentation.Slides.Item(2);

Is there a way to determine the index of the current selected slide?

Thanks,
Ralf
Posted 03 Feb, 2017 18:11:03 Top
Ralf Garbe




Posts: 20
Joined: 2014-11-22
OK,
I found a solution using PowerPointApp.ActiveWindow.Selection.SlideRange
with that I could for instance make the Footer visible and set to a certain value:

for i := 1 to PowerPointApp.ActiveWindow.Selection.SlideRange.Count do begin
PowerPointApp.ActiveWindow.Selection.SlideRange.Item(i).HeadersFooters.Footer.Visible := 1;
PowerPointApp.ActiveWindow.Selection.SlideRange.Item(i).HeadersFooters.Footer.Text := s; end;

Best Regards,
Ralf
Posted 05 Feb, 2017 16:46:14 Top
Andrei Smolin


Add-in Express team


Posts: 18821
Joined: 2006-05-11
Hello Ralf,

Ralf Garbe writes:
Is there a way to determine the index of the current selected slide?


procedure TAddInModule.adxRibbonTab1Controls0Controls0Click(
  Sender: TObject; const RibbonControl: IRibbonControl);
var
  slide: IDispatch;
begin
  slide := self.PowerPointApp.ActiveWindow.View.Slide;
  ShowMessage(intToStr(OleVariant(slide).SlideIndex));
end;



Andrei Smolin
Add-in Express Team Leader
Posted 06 Feb, 2017 07:55:07 Top
Ralf Garbe




Posts: 20
Joined: 2014-11-22
Andrei,
thanks for that great solution which gives access to all of the slide methods and properties.

Best Regards,
Ralf
Posted 10 Feb, 2017 15:52:43 Top