Share via


GetWidth Method [Publisher 2003 VBA Language Reference]

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

expression.GetWidth(Unit)

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

PbUnitType

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

Remarks

Use the GetHeight 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.

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

Applies to | Shape Object | ShapeRange Collection