Share via


Shape.ZOrder Method

Moves the specified shape in front of or behind other shapes in the collection (that is, changes the shape's position in the z-order).

Namespace:  Microsoft.Office.Interop.PowerPoint
Assembly:  Microsoft.Office.Interop.PowerPoint (in Microsoft.Office.Interop.PowerPoint.dll)

Syntax

'Declaration
Sub ZOrder ( _
    ZOrderCmd As MsoZOrderCmd _
)
'Usage
Dim instance As Shape
Dim ZOrderCmd As MsoZOrderCmd

instance.ZOrder(ZOrderCmd)
void ZOrder(
    MsoZOrderCmd ZOrderCmd
)

Parameters

Remarks

The ZOrderCmd parameter value can be one of these MsoZOrderCmd constants.

msoBringForward

msoBringInFrontOfText

msoBringToFront

msoSendBackward

msoSendBehindText

msoSendToBack

The msoBringInFrontOfText and msoSendBehindText constants should be used only in Microsoft Office Word.

Use the ZOrderPosition property to determine a shape's current position in the z-order.

Examples

This example adds an oval to myDocument and then places the oval second from the back in the z-order if there is at least one other shape on the slide.

Set myDocument = ActivePresentation.Slides(1)

With myDocument.Shapes.AddShape(msoShapeOval, 100, 100, 100, 300)

    While .ZOrderPosition > 2

        .ZOrdermsoSendBackward

    Wend

End With

See Also

Reference

Shape Interface

Shape Members

Microsoft.Office.Interop.PowerPoint Namespace