WidthRule Property

Microsoft Word Visual Basic

Show All

WidthRule Property

       

Returns or sets the rule used to determine the width of a frame. Read/write WdFrameSizeRule.

WdFrameSizeRule can be one of these WdFrameSizeRule constants.
wdFrameAtLeast Sets the width to a value equal to or greater than the value specified by the Width property.
wdFrameAuto Sets the width according to the width of the item in the frame.
wdFrameExact Sets the width to an exact value specified by the Width property.

expression.WidthRule

expression   Required. An expression that returns a Frame object.

Example

This example sets the width of the last frame in the active document to exactly 72 points (1 inch).

If ActiveDocument.Frames.Count >= 1 Then
    With ActiveDocument.Frames(ActiveDocument.Frames.Count)
        .WidthRule = wdFrameExact
        .Width = 72
    End With
End If