How high will attextbox end up

  • Thread starter Thread starter Phil Stanton
  • Start date Start date
P

Phil Stanton

I am trying to create a text box in Word the same height as one on an
access report
and then fill it with text.
I can "read" the top and left and position of the text box from the report
OK and create a
text box in Word with the correct position, but it's size is identical to
the size of the "ungrown" text box on the report. I need to create the text
box in Word the same size as the grown text box on the report.

So, in Design view the report has a text box about 1cm (570 twips) high.
It's properties are CanGrow yes and CanShrink yes. It is bound to a memo
field. Sometimes the box is big enough to hold all the data, but more
frequently it will have to grow to up to 10cms high to accommodate the
data..

I need to create the text box in Word the same size as the report textbox in
print or preview mode ie from 1cm to 10cms high in order to hold the data.

I have tried using OnFormat MyReport.TextHeight(MyMemo) but that only gives
the original textbox height.

Can anyone help

Thanks

Phil
 
Phil said:
I am trying to create a text box in Word the same height as one on an
access report
and then fill it with text.
I can "read" the top and left and position of the text box from the report
OK and create a
text box in Word with the correct position, but it's size is identical to
the size of the "ungrown" text box on the report. I need to create the text
box in Word the same size as the grown text box on the report.

So, in Design view the report has a text box about 1cm (570 twips) high.
It's properties are CanGrow yes and CanShrink yes. It is bound to a memo
field. Sometimes the box is big enough to hold all the data, but more
frequently it will have to grow to up to 10cms high to accommodate the
data..

I need to create the text box in Word the same size as the report textbox in
print or preview mode ie from 1cm to 10cms high in order to hold the data.

I have tried using OnFormat MyReport.TextHeight(MyMemo) but that only gives
the original textbox height.

The TextHeight method does not give the text box's original
height, it tells you the eventual height of the memo's text
if it were placed in a text box that was the same width as
the report, but using the report's current Font, FontSize,
bold, etc. properties. In other words, it's pretty
worthless.

You can use Stephen Lebans' TextHeightWidth function in the
section's Format event to determine the eventual height of a
CanGrow/CanShrink text box.

OTOH, if you can wait until the section's Print event the
height of the text box will have had it's Height property
adjusted to its final height.
 
Thanks for that.It looks very promising.As usual Stephen seems to have
cracked it first

Phil
 
Back
Top