Org Wiz shape resize

J

JP

I am developing a basic app in .net that passes args to the org chart wizard
to produce an org chart based on data storted in sql server.

Once the shapes and data are generated and displayed the app loops through
the shapes to resize them vertically to fit the text. To accomplish this I am
using the following:

thisShape.Cells("Height").FormulaForce = String.Format("=TEXTHEIGHT(TheText,
1) * 1.025")

This appears to work - in fact you can see it working - for nearly all
shapes however invariably there are a few shapes for which the text still
hangs over the shape. If I run the app again it will be a different,
seemingly random few shapes which do not get fully resized. Manually
reviewing the shape sheet shows that the formula is being correctly inserted.

Any thoughts are appreciated.



---

A few additional items regarding environment:

1. Visio 2007
2. VS 2005, vb.net
3. I am passing commandPart = "/SHOW-DIVIDER-LINE=1"
 
M

Mark Nelson [MS]

I'm not sure why you are passing in a value of 1 in the TEXTHEIGHT function.
TEXTHEIGHT calculates the height of the text if the width of the text box is
"W" - where "W" is the second argument. You are asking Visio to calculate
the height assuming that the text box is 1 inch wide, but it might be
something else. Try passing in TxtWidth instead of 1.

This may not be the only issue, but it is a place to start.

--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
 
J

JP

Makes sense and worked like a charm. Many Thanks

Mark Nelson said:
I'm not sure why you are passing in a value of 1 in the TEXTHEIGHT function.
TEXTHEIGHT calculates the height of the text if the width of the text box is
"W" - where "W" is the second argument. You are asking Visio to calculate
the height assuming that the text box is 1 inch wide, but it might be
something else. Try passing in TxtWidth instead of 1.

This may not be the only issue, but it is a place to start.

--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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