Consulting

Results 1 to 2 of 2

Thread: Zorder query

  1. #1

    Zorder query

    Hello all,

    How to create a vba code in ppt2007 to sort the zorder position for the selected shapes?

    For eg., I have vertically 10 text boxes distributed equally with different zorder position. If I select all the 10 text boxes (from top to bottom) and run the code, the zorder position should be sorted from top to bottom.

    Please help me on this.

    Thanks and Regards,
    Balu.

  2. #2
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    Something based on this maybe:

    [VBA]Sub zsort()
    Dim i As Integer
    For i = 2 To ActiveWindow.Selection.ShapeRange.Count
    Do
    ActiveWindow.Selection.ShapeRange(i).ZOrder (msoBringForward)
    Loop Until ActiveWindow.Selection.ShapeRange(i).ZOrderPosition > ActiveWindow.Selection.ShapeRange(i - 1).ZOrderPosition
    Next i
    End Sub[/VBA]
    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
  •