Table of contents
TOC
Collapse the table of content
Expand the table of content

ShapeRange.GetLeft Method (Publisher)

office 365 dev account|Last Updated: 8/24/2017
|
3 Contributors

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

Syntax

expression. GetLeft( Unit)

_expression_A variable that represents a ShapeRange object.

Parameters

NameRequired/OptionalData TypeDescription
UnitRequiredPbUnitTypeThe units in which to return the distance.

Return Value

Single

Remarks

The Unit parameter can be one of the PbUnitType constants declared in the Microsoft Publisher type library.

Use the GetTop method to return the distance of a shape's or shape range's top edge from the top 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 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
© 2018 Microsoft