Printer Object
 
Syntax
 
Printer.CalcParagraph = strText
 
Description
Calculates the size of a paragraph in twips, and returns the result in TextWid, TextHei, X1, X2, Y1, and Y2.
 
You can use this property to determine whether a paragraph will fit on the current page or to position graphical elements with respect to the paragraph.
 
To draw shaded paragraphs, see also the Textbox method.
 
For example, the code in the sample below renders several paragraphs of text and makes sure no paragraph is broken across page breaks.
See Also
Example
 
Sub Main
Dim i%, s$
 
s = "This is a long paragraph. " & _
    "A very long one, really. "
s = s & s & s & s & s & s & s & s
 
With Printer
   ‘Printer object activeren:
   If Not.Init() Then End
   .SpaceAfter = "0.5in"
   For i = 0 To 100
      .CalcParagraph = s
      If .CurrentY + .TextHei > .PageHeight - .MarginBottom Then
         .NewPage
      End If
      .Paragraph = s
   Next
   .Submit
 
End With
 
End Sub