• find current slide index in slidesorter (PPT97)

    Home » Forums » AskWoody support » Productivity software by function » MS PowerPoint and presentation apps » find current slide index in slidesorter (PPT97)

    Author
    Topic
    #362678

    The following code snippet returns the current slide index when the Slide view is active:

    iCurrentIndex = ActiveWindow.View.Slide.SlideIndex

    What’s the equivalent for when the SlideSorter view is active? I want to create a new slide using VBA, and have it appear after the current slide. Using my current code, the iCurrentIndex always reverts to 0 (error trapping), which creates the slide out of order.

    Thx.

    Viewing 0 reply threads
    Author
    Replies
    • #551360

      Jack, you cannot find the slide number in SlideSorter view. In fact, you really can’t do anything in SlideSorter view. What you want to do before just about any PP macro is save the current slide view, reset it to Slide view, do the macro, and then reset the slide view to what you started with. Keeps everyone happy! Try out the macro below.

      Sub whichSlide()
      Dim saveView As Long
          With ActiveWindow
              saveView = .ViewType
              .ViewType = ppViewSlide
              MsgBox .View.Slide.SlideIndex
              .ViewType = saveView
          End With
      End Sub

      HTH –Sam

    Viewing 0 reply threads
    Reply To: find current slide index in slidesorter (PPT97)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: