Adapt shape's text to shape's size using character size

R

Ralle

Hello,
I try to get a shape that doesn't adapt to the text, but to get a text that
adapts to the shape size. This means, if I add a larger text the char size
will be decreased and if I add a shorter text , the char size will be
increased up to a default size.

I added this formula to the Scratch.A1 cell of a shape:
=IF(TEXTWIDTH(TheText)>Width,SETF("Char.Size",Char.Size-1
pt),SETF("Char.Size",MIN(Char.Size+1 pt,9 pt)))

Using Visio 2002 or 2003 it works fine, but using Visio 2007 I got a -401 pt
Char.Size and only a grey bar in the shape.
So I havn't any idea how to fix this.

Many thank's in advance.

Ralph
 
J

JuneTheSecond \)cotton.ocn.ne.jp>

Ralle,

The reason is due to a kind of circular cell references.
Visio2007 has a high performance of cell calculations,
and circular calculation may be done to high degrees.
You might need to find any other way.
It is documented anywhere in msdn that Microsoft
does not recomend to use circular cell references,
nor guarantee the results of circular cell references.

By the way, I uploaded many shapes that make bad use of
the circular cell references in my home page.

--
Best Regards.

JuneTheSecond
Now the Visual calculation is more visual.
http://www.geocities.jp/visualcalculation/english/index.html
 
R

Ralle

JuneTheSecond,

thank you for your response.

This explains the behavior using Visio2007. What a bummer!

In most instances I'll replace the dynamic by a simple if-else logic.
But in certain cases I really need the dynamic. So it seems I have to write
a new method for our Visio-DLL to solve the problem.

With my best regards

Ralph
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top