Table of contents
Collapse the table of content
Expand the table of content

TextFrame2.AutoSize Property (Office)

office 365 dev account|Last Updated: 6/12/2017
1 Contributor

Returns or sets a value that indicates whether the size of the specified shape is changed automatically to fit text within its boundaries. Read/write


expression. AutoSize

expression An expression that returns a TextFrame2 object.


The value of the AutoSize property can be one of the following MsoAutoSize constants.

|| |:-----| |msoAutoSizeMixed| |msoAutoSizeNone| |msoAutoSizeShapeToFitText| |msoAutoSizeTextToFitShape|


The following code shows how to adjust the size of the title text on slide one to fit the text frame that contains it.

Dim pptSlide As Slide 
 Set pptSlide = ActivePresentation.Slides(1) 
With pptSlide.Shapes(1) 
 If .TextFrame2.TextRange.Characters.Count < 50 Then 
 .TextFrame2.AutoSize = msoAutoSizeTextToFitShape 
 End If 
End With

See also


TextFrame2 Object

Other resources

TextFrame2 Object Members

© 2018 Microsoft