Get Current Slide Number And Insert a New Slide

I've recorded a macro to perform certain formating to slides in a ppt 2003 show.

I would like to enhance it by having it insert a new slide after the current slide (as the standard action with CTRL+M)

When I record the macro, however, the slide number being inserted is hardcoded - I want the macro to insert after the now current slide.

When I record inserting after slide #2, the applicable macro line reads:

ActivePresentation.Slides.Add(Index:=3, Layout:=ppLayoutText).Select

How can I get the macro to determine the "current" slide # and change that index:=3 to the apprpriate numebr (or variable containing that number

TIA


Answer this question

Get Current Slide Number And Insert a New Slide

  • Horst Klein

    Have a look at this page, which includes a function to determine active slide index.
    http://officeone.mvps.org/vba/get_active_slide.html


  • Dipendra

    Thx
  • Get Current Slide Number And Insert a New Slide