The TextHeight method returns the height of a text string as it would be printed in the current font of a Report object.
Syntax
object.TextHeight(strexpr)
The TextHeight method has the following arguments.
Argument | Description |
---|---|
object | The Report object that determines the font and font point size. |
strexpr | The text string for which the text height will be determined. |
Remarks
You can use the TextHeight method to determine the amount of vertical space a text string will require in the current font when the report is formatted and printed. For example, a text string formatted in 9-point Arial will require a different amount of space than one formatted in 12-point Courier. To determine the current font and font size for text in a report, check the settings for the report's FontName and FontSize properties.
The value returned by the TextHeight method is expressed in terms of the coordinate system in effect for the report, as defined by the Scale method. You can use the ScaleMode property to determine the coordinate system currently in effect for the report.
If the strexpr argument contains embedded carriage returns, the TextHeight method returns the cumulative height of the lines, including the leading space above and below each line. You can use the value returned by the TextHeight method to calculate the necessary space and positioning for multiple lines of text within a report.