none
VSTO Powerpoint Slidenumber or Title in a MsgBox RRS feed

  • Question

  • Hello everyone,

    I search for the right syntax or line of code to read the actual slidenumber and the title of the actual running fullscreen presentation and show it in a MsgBox.

    for example:

    Private Sub nextSlide() Handles Application.SlideShowNextSlide
    MsgBox("SlideNr" + "title")
    End Sub

    Thursday, February 18, 2016 3:58 PM

Answers

  • Hi jufk,

    >> the title of the actual running fullscreen presentation and show it in a MsgBox.

    What do you mean of title? Do you mean the title you enter in “"Click to add title"” when you create a new slide? If so, you could try the code below:

        Private Sub ThisAddIn_Startup() Handles Me.Startup
            AddHandler Application.SlideShowNextSlide, AddressOf Application_SlideShowNextSlide
        End Sub
        Private Sub Application_SlideShowNextSlide(ByVal Wn As Microsoft.Office.Interop.PowerPoint.SlideShowWindow)
            Dim a As PowerPoint.Slide
            a = Wn.View.Slide
            MsgBox(a.SlideNumber.ToString() + ";" + a.Shapes.Title.TextFrame.TextRange.Text)
        End Sub

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Marked as answer by jufk Friday, February 19, 2016 11:38 AM
    Friday, February 19, 2016 9:41 AM

All replies

  • Hi jufk,

    >> the title of the actual running fullscreen presentation and show it in a MsgBox.

    What do you mean of title? Do you mean the title you enter in “"Click to add title"” when you create a new slide? If so, you could try the code below:

        Private Sub ThisAddIn_Startup() Handles Me.Startup
            AddHandler Application.SlideShowNextSlide, AddressOf Application_SlideShowNextSlide
        End Sub
        Private Sub Application_SlideShowNextSlide(ByVal Wn As Microsoft.Office.Interop.PowerPoint.SlideShowWindow)
            Dim a As PowerPoint.Slide
            a = Wn.View.Slide
            MsgBox(a.SlideNumber.ToString() + ";" + a.Shapes.Title.TextFrame.TextRange.Text)
        End Sub

    Best Regards,

    Edward


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    • Marked as answer by jufk Friday, February 19, 2016 11:38 AM
    Friday, February 19, 2016 9:41 AM
  • Hi Edward,

    thanks for your answer, that's exactly what I searched for.

    Best Regards,

    jufk

    Friday, February 19, 2016 11:45 AM