API Documentation > CorelDRAW > 2025-v26 > Text > IVGText
Text.FitTextToFrame method
Fits the text to a frame
Syntax:
Sub FitTextToFrame()
Remarks:
The FitTextToFrame method fits text to a frame.
Examples:
The following VBA example creates paragraph text and fits the text to the frame.
Sub Test()
Dim d As Document
Dim s As Shape
Dim t As Text
Set d = CreateDocument
Set s = d.ActiveLayer.CreateParagraphText(2, 4, 6, 9, _
  "This is a test for the frames.")
Set t = s.Text
t.FitTextToFrame 
End Sub