Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
Solved

# Sizing shapes to text in Viso2007 SP1

Posted on 2012-03-29
Medium Priority
492 Views
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).

0
Question by:dsw_appl
[X]
###### Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

• Help others & share knowledge
• Earn cash & points
1 Comment

LVL 31

Accepted Solution

Scott Helmers earned 1500 total points
ID: 37786833
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

## Featured Post

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question