ShapeRange.GetHeight Method

Publisher Developer Reference

Returns the height of the shape or shape range as a Single in the specified units.

Syntax

expression.GetHeight(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 height.

Return Value
Single

Remarks

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

Use the GetWidth method to return the width of a shape or shape range.

Example

The following example displays the height and width in inches (to the nearest hundredth) of the shape range consisting of all the shapes on the first page of the active publication.

Visual Basic for Applications
  With ActiveDocument.Pages(1).Shapes.Range
    MsgBox "Height of all shapes: " _
        & Format(.GetHeight(Unit:=pbUnitInch), "0.00") _
        & " in" & vbCr _
        & "Width of all shapes: " _
        & Format(.GetWidth(Unit:=pbUnitInch), "0.00") _
        & " in"
End With

See Also