1
votes

I am writing a small plugin on ASP.NET C# VSTO and I want to be able to capture slide number and title of the slides when a slideshow is happening.

Can someone share sample code to capture title of the slide and slide number?

3

3 Answers

1
votes
PowerPoint.SlideShowWindow.Presentation.SlideShowWindow.View.CurrentShowPosition
0
votes

Presentation pres = Globals.ThisAddIn.Application.ActivePresentation;

        foreach (Slide s in pres.Slides)
        {

            MessageBox.Show(s.SlideIndex);
        }

The Slide title I don't know, yet

0
votes

Capture event SlideShowNextSlide and from the Wn variable, get the slide's index/title. Here's a VBA example:

Private Sub app_SlideShowNextSlide(ByVal Wn As SlideShowWindow)
Dim s As Slide
s = Wn.View.Slide
Dim slideTitle As String


If s.Layout <> ppLayoutBlank Then
    If s.Shapes.HasTitle Then
        slideTitle = s.Shapes.Title
    Else
        slideTitle = "(nothing)"
    End If
End If

Dim sIndex As Integer
sIndex = s.SlideIndex

End Sub