Printer Object
 
Syntax
 
Printer.TextBox(Text, X1, Y1, boxWidth, boxHeight[, Wrap][, Calc][, Shade]
 
Description
Draws text within a rectangle.
 
This property returns the height, in twips, of an element measured with the Measure property or with one of the Calc* properties. These include CalcText, CalcParagraph, CalcTable, CalcPicture, and CalcTextRTF.
 
Parameter
Description
Text
Text to be drawn in the text box. It may be plain text or it may contain RTF text enclosed in curly braces ("{}").
X, Y,
Coordinates of the upper left corner of the box. You may specify the units for these parameters. The default unit is twips.
Width
The width of the text box, in twips or explicit units.
Height
The height of the text box, in twips or explicit units. If this parameter is set to zero, the height is calculated automatically so the text fits within the box.
Wrap
Specifies whether text should be allowed to wrap within the box. Optional, defaults to True.
Calc
Specifies whether the text box should only be calculated, and not rendered. Optional, defaults to False. If you set this parameter to True, no text is drawn and the dimensions of the text box are returned in the TextWid and TextHei properties. This is useful if you want to determine whether a text box will fit on the current page.
Shade
Specifies whether the text box will be outlined with the current pen and shaded with the current brush. Optional, defaults to False.
 
Several properties affect the way text is drawn within the text boxes. The main ones are Font, TextColor, TextAlign, TextAngle, SpaceBefore, SpaceAfter, IndentLeft, IndentRight, and LineSpacing.
 
You can use the TextBox method to build sophisticated reports with total control over text positioning and page breaks, or forms with arbitrary field positioning.
 
See Also
 
Example