View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Russ Russ is offline
external usenet poster
 
Posts: 108
Default Finding the length of proportional text strings

Hi Helmut,
Thanks for you reply. Actually I do leave it to Word when I construct the
finished product. However, all the text is entered in Excel over time and I
want to be sure everything fits before I, once a year, produce the finished
product.
The technique I use works quite well but it is rather kluggy. I guess I
will just have to live with it.
Thanks again.
--
russ


"Helmut Weber" wrote:

Hi Russ

I don't think there is much else you can do.
Even if some api functions like GetTextMetrics
which i am not familiar with,
would tell you how wide your text is,
you still would have to calculate the maximum width beforehand,
get the width of a space
und add as many spaces at once to get the perfect width.

I even doubt, whether adding spaces the way you do in Excel,
will always show the desired effect in Word.
Does it? Then I have once again learned something.

How about leaving it all to Word.
Wouldn't be any more elegant, though,
but then you would know, whether the text fits
according to Word's way of calculating it.

In Word you would use Range.ComputeStatistics(wdStatisticLines).
But, i'm sure, there was no need of telling you that.

Have a nice day.

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"