Results 1 to 17 of 17

Thread: Check if shape is in specific location in slide

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #10
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,096
    Location
    This is kinda hard to explain but because you are changing the order of slides within the loop you are moving some "target" slides twice. eg the original slide 2 becomes slide 7 when slide 4 moves and is moved again. You will need to start at the end of the presentation and work backwards
    using something like

    Sub sort()
    Dim i As Integer
    Dim z As Integer
    'if slide has a shape at 156 and 516.75 then move the slide to the back of the presentation. These slides are referred
    'to in comments as "facing pages"
    For i = ActivePresentation.Slides.Count To 1 Step -1
        For Each sh In ActivePresentation.Slides(i).Shapes
            If sh.Left = 156 And sh.Top = 516.75 Then
                'move slide to end (or end -z)
                ActivePresentation.Slides(i).MoveTo ActivePresentation.Slides.Count - z
                z = z + 1
            End If
        Next
    Next
    This would of course give you 3, 2 ,1 but should be a starting point (note code has been edited so the order is now 1,2,3)
    Last edited by Aussiebear; 04-28-2023 at 01:46 AM. Reason: Adjusted the code tags
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

Posting Permissions

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