GetLeft Method

Microsoft Publisher Visual Basic

expression.GetLeft(Unit)

expression    Required. An expression that returns one of the objects in the Applies To list.

Unit   Required PbUnitType. The units in which to return the distance.

PbUnitType can be one of these PbUnitType constants.
pbUnitCM
pbUnitEmu
pbUnitFeet
pbUnitHa
pbUnitInch
pbUnitKyu
pbUnitMeter
pbUnitPica
pbUnitPoint
pbUnitTwip

Remarks

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