Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Jun 2004
    Location
    Gtr London, England
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Where am I? (PowerPoint 2003)

    How I wished I never started development in PowerPoint !!

    Can someone help .... please !! I have a set of slides 4, at the front end I have selected Slide 2, through VBA I want to find out which slide has been selected, so that I can input a new slide above the selected slide. I have searched but can't seem to find what I need.

    Many thanks
    Jack

  2. #2
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Where am I? (PowerPoint 2003)

    <hr>How I wished I never started development in PowerPoint !!<hr>
    Just think of it this way; if you didn't start the development, you'd be less informed than you are right now. Development is a patience game...trial and error, frustration and victory....and the bonus is an automated application! The rewards are just too great to give up.

    Regarding your query. I'm not sure if it is very clear to other loungers what you are trying to achieve. Could you be more specific in the description of what you are trying to do. Are you working in Slide Sorter View? Can you supply us with the coding you currently have? I'm sure someone will be able to assist then!

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16>
    Regards,
    Rudi

  3. #3
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Where am I? (PowerPoint 2003)

    <P ID="edit" class=small>(Edited by AlanMiller on 16-Feb-05 23:49. Tested and changed code)</P>Don't do much in Powerpoint, but this code snippet appears to work:
    <pre>Public Sub InsertSlideBefore()
    Dim oView As View
    With ActivePresentation.Slides
    Set oView = ActiveWindow.View
    If oView.Slide.SlideIndex > 1 Then
    oView.GotoSlide .Add(oView.Slide.SlideIndex - 1, _
    ppLayoutTitleOnly).SlideIndex
    Else
    oView.GotoSlide .Add(1, _
    ppLayoutTitleOnly).SlideIndex
    End If

    Set oView = Nothing
    End With

    End Sub
    </pre>


    Alan

  4. #4
    Star Lounger
    Join Date
    Jun 2004
    Location
    Gtr London, England
    Posts
    90
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Where am I? (PowerPoint 2003)

    Hi Alan

    Thanks for your help .... did find a quick solution in the end (via another Forum) - ActiveWindow.Selection.SlideRange(1) identifies the slide. So I then set the slide up and was able to insert the new slide in the correct place (see below - that's if you're interested !!)

    Set sldSlide = ActiveWindow.Selection.SlideRange(1)
    lngSlide = sldSlide.SlideIndex
    Set sldSlide = prePresentation.Slides.Add(lngSlide, ppLayoutText)

    It's all going fabulously now - well until I find another problem !!!

    Regards
    Jack

  5. #5
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Where am I? (PowerPoint 2003)

    That solution looks to be obviously better.. now that I see it in print. It (automatically) pushes every slide in the collection to a higher index as required, to accommodate the insertion at the current point. Glad it's working.

    Alan

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •