Skip to content

Latest commit

 

History

History
57 lines (37 loc) · 1.66 KB

Publisher.ShapeRange.GetTop.md

File metadata and controls

57 lines (37 loc) · 1.66 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
ShapeRange.GetTop method (Publisher)
vbapb10.chm2293783
vbapb10.chm2293783
Publisher.ShapeRange.GetTop
bbee5dec-78fd-efd9-1368-2089a44d9bff
06/14/2019
medium

ShapeRange.GetTop method (Publisher)

Returns the distance of the shape's or shape range's top edge from the top edge of the leftmost page in the current view as a Single in the specified units.

Syntax

expression.GetTop (Unit)

expression A variable that represents a ShapeRange object.

Parameters

Name Required/Optional Data type Description
Unit Required PbUnitType The units in which to return the distance. Can be one of the PbUnitType constants declared in the Microsoft Publisher type library.

Return value

Single

Remarks

Use the GetLeft method to return the distance of a shape's or shape range's left edge from the left edge of the leftmost page in the current view.

Example

The following example displays the distances from the left and top edges of the leftmost page to the left and top edges of the shape range consisting of all the shapes on the first page. The distances are expressed in inches (to the nearest hundredth).

With ActiveDocument.Pages(1).Shapes.Range 
 MsgBox "Distance from left: " _ 
 & Format(.GetLeft(Unit:=pbUnitInch), "0.00") _ 
 & " in" & vbCr _ 
 & "Distance from top: " _ 
 & Format(.GetTop(Unit:=pbUnitInch), "0.00") _ 
 & " in" 
End With

[!includeSupport and feedback]