PreferredWidthType Property

Microsoft Word Visual Basic

Show All

PreferredWidthType Property

       

Returns or sets the preferred unit of measurement to use for the width of the specified cells, columns, or table. Read-only WdPreferredWidthType for the ConditionalStyle and TableStyle objects; read/write WdPreferredWidthType for all other objects in the Applies To list.

WdPreferredWidthType can be one of these WdPreferredWidthType constants.
wdPreferredWidthAuto
wdPreferredWidthPercent
wdPreferredWidthPoints

expression.PreferredWidthType

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

Example

This example sets Microsoft Word to accept widths as a percentage of window width, and then it sets the width of the first table in the document to 50% of the window width.

With ActiveDocument.Tables(1)
    .PreferredWidthType = wdPreferredWidthPercent
    .PreferredWidth = 50
End With