TextFrame2.AutoSize Property
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.
Namespace: Microsoft.Office.Interop.PowerPoint
Assembly: Microsoft.Office.Interop.PowerPoint (in Microsoft.Office.Interop.PowerPoint.dll)
Syntax
'Declaration
Property AutoSize As MsoAutoSize
Get
Set
'Usage
Dim instance As TextFrame2
Dim value As MsoAutoSize
value = instance.AutoSize
instance.AutoSize = value
MsoAutoSize AutoSize { get; set; }
Property Value
Type: Microsoft.Office.Core.MsoAutoSize
MsoAutoSize
Remarks
The value of the AutoSize property can be one of the following MsoAutoSize constants.
msoAutoSizeMixed |
msoAutoSizeNone |
msoAutoSizeShapeToFitText |
msoAutoSizeTextToFitShape |
Examples
The following example shows how to adjust the size of the title text on slide one to fit the text frame that contains it.
Public Sub AutoSize_Example()
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
End Sub