Width Property

Microsoft Publisher Visual Basic

Returns a Single that represents the width, in points, of the page (for the ReaderSpread object) or the printable rectangle (for the PrintableRect object). Read-only.

expression.Width

expression    Required. An expression that returns one of the above objects.

ShowWidth property as it applies to the Label object.

Returns or sets a Variant that represents the width (in points) of the label. Read-only.

expression.Width

expression    Required. An expression that returns one of the above objects.

ShowWidth property as it applies to the Window object.

Returns or sets a Long that represents the width (in points) of the window. Read/write.

expression.Width

expression    Required. An expression that returns one of the above objects.

ShowWidth property as it applies to the Cell, CellRange, and Page objects.

Returns a Long that represent the width (in points) of a cell, range of cells, or page. Read-only.

expression.Width

expression    Required. An expression that returns one of the above objects.

ShowWidth property as it applies to the Column and Shape objects.

Returns or sets a Variant that represents the width (in points) of a specified table column or shape. Read/write.

expression.Width

expression    Required. An expression that returns one of the above objects.

ShowWidth property as it applies to the ShapeRange object.

Returns a Variant that represents the width (in points) of a specified range of shapes. Read-only.

expression.Width

expression    Required. An expression that returns one of the above objects.

ShowWidth property as it applies to the PictureFormat object.

Returns a Variant that represents the width, in points, of the specified picture. Read-only.

expression.Width

expression    Required. An expression that returns a PictureFormat object.

Example

ShowAs it applies to the Window object.

This example sets the height and width of the active window if the window is neither maximized nor minimized.

Sub SetWindowHeight()
    With ActiveWindow
        If .WindowState = pbWindowStateNormal Then
            .Height = InchesToPoints(5)
            .Width = InchesToPoints(5)
        End If
    End With
End Sub
				

ShowAs it applies to the Column object.

This example creates a new table and sets the height and width of the second row and column, respectively.

Sub SetRowHeightColumnWidth()
    With ActiveDocument.Pages(1).Shapes.AddTable(NumRows:=3, _
            NumColumns:=3, Left:=80, Top:=80, Width:=400, Height:=12).Table
            .Rows(2).Height = 72
            .Columns(2).Width = 72
    End With
End Sub