James
James

Reputation: 439

How to get the ids of selected slides

I need the ids of the slides that the user has selected in the left pane.

In the image below it would be 1 and 3.

Is there a method I can use or do I need to loop through all slides and check some property?

PowerPoint 2013 Slide Pane

Update: Solution based on Steve Rindsberg's VBA solution.

foreach (PowerPoint.Slide sld in Application.ActiveWindow.Selection.SlideRange)
{
  int s = sld.SlideNumber;
}

Upvotes: 2

Views: 1489

Answers (1)

Steve Rindsberg
Steve Rindsberg

Reputation: 14810

You'd do it like so in VBA

   Dim oSl As Slide
    For Each oSl In ActiveWindow.Selection.SlideRange
        Debug.Print oSl.SlideID
    Next

Upvotes: 2

Related Questions