Skip to content

Latest commit

 

History

History
52 lines (33 loc) · 1.53 KB

Publisher.Shape.ZOrderPosition.md

File metadata and controls

52 lines (33 loc) · 1.53 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Shape.ZOrderPosition property (Publisher)
vbapb10.chm2228312
vbapb10.chm2228312
Publisher.Shape.ZOrderPosition
46eb765b-578e-f6df-43b7-c14443cddbb2
06/13/2019
medium

Shape.ZOrderPosition property (Publisher)

Returns a Long indicating the position of the specified shape or shape range in the z-order. Read-only.

Syntax

expression.ZOrderPosition

expression A variable that represents a Shape object.

Remarks

A shape's position in the z-order corresponds to the shape's index number in the Shapes collection.

For example, if there are four shapes on the page, the expression ActiveDocument.Pages(1).Shapes(1) returns the shape at the back of the z-order, and the expression ActiveDocument.Pages(1).Shapes(4) returns the shape at the front of the z-order.

Whenever you add a new shape to a collection, it is added to the front of the z-order by default.

To set the shape's position in the z-order, use the ZOrder method.

Example

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

With ActiveDocument.Pages(1).Shapes _ 
 .AddShape(Type:=msoShapeOval, _ 
 Left:=100, Top:=100, Width:=100, Height:=300) 
 Do While .ZOrderPosition > 2 
 .ZOrder msoSendBackward 
 Loop 
End With 

[!includeSupport and feedback]