April 2006
Beginner
1114 pages
98h 16m
English
textframe.AutoSize [= setting]
True resizes the object to fit the text; False does not resize. Default is False. The following code draws an oval, adds some text, then resizes the shape to fit the text:
Sub DrawOval( )
Dim ws As Worksheet, s As Shape
Set ws = ActiveSheet
' Draw a rectangle.
Set s = ws.Shapes.AddShape(msoShapeOval, 150, 50, 1, 1)
' Add some text
s.TextFrame.Characters.text = "Vigorous writing is concise."
' Resize the object to fit text
s.TextFrame.AutoSize = True
End SubRead now
Unlock full access