Sizing shapes to text in Viso2007 SP1

Hi,
is there any possibility to fit the size of the text to the shape? I found already some articles about how to size the shape to the text but not in reverse.

For instance:
I have a shape with locked height and width and the standart text size is 9pt. If the text is too big for the shape it should resize to fit(for instance 6pt).

LVL 2
Who is Participating?

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Visio Consultant, Trainer, Author, and DeveloperCommented:
The trick lies in adding a formula to the char size cell in the shapesheet. For example the formula below uses the LEN() function to set the text size in three increments:
-- if < 20 characters then 12 pt.
-- if >=20 but < 30 then 10 pt.
-- if >= 30 then 8 pt.

BTW, the SHAPETEXT(TheText) function obtains the text on the shape.

=IF(LEN(SHAPETEXT(TheText))<20,12 pt,IF(LEN(SHAPETEXT(TheText))<30,10 pt,8 pt))

This is just one possible formula, of course. You can set additional step points, or you could devise a mathematical relationship that doesn't use arbitrary steps.
The formula is shown in the shapesheet below
0

Experts Exchange Solution brought to you by