Share via


AutoFitText Property [Publisher 2003 VBA Language Reference]

PbTextAutoFitType

PbTextAutoFitType can be one of these PbTextAutoFitType constants.
pbTextAutoFitBestFit Text frame size adjusts to fit text.
pbTextAutoFitNone Allows text to overflow the text frame.
pbTextAutoFitShrinkOnOverflow Text font reduces so text fits within the text frame.

expression.AutoFitText

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

Example

The following example tests to see if the text frame has text, and if so, the AutoFitText property is set to best fit.

Sub TextFit()

    Dim tfFrame As TextFrame

    tfFrame = Application.ActiveDocument.MasterPages.Item(1).Shapes(1).TextFrame
    With tfFrame
        If .HasText = msoTrue Then .AutoFitText = pbTextAutoFitBestFit
    End With

End Sub

Applies to | TextFrame Object