Visio Shape Text positioning below the shape using Text Transform

731 views Asked by At

I have a building a set of stencil shapes and I need the text to display below the shape. I am using custom formulas to generate the text, and as such the volume of text changes from use case to use case.

What I have come across is using the Text Transform set of properties, and I have tried the following with success for a single line of text:

TxtWidth = TEXTWIDTH(TheText)
TxtPinX = Width * 0.5
TxtLocPinX = TxtWidth * 0.5
TxtHeight = Height * 0
TxtPinY = Height * -0.2
TxtLocPinY = TxtHieght * 0.5
TxtAngle = 0 deg

The problem arises when there is more than a single line of text to display -> the text appears 'half above (inside) and half below' the bottom the shape.

I would like to place all the text, regardless of how many lines there are, underneath the shape.

What I have tried is to set the TxtPinY = some formula different from above eg/ Height * -(TxtHeight). This seems to always result in an 'error in formula'.

I am sure that this is something simple that I am missing, but I cannot figure it out.

Can anybody point me in the right direction?

Cheers and thanks for taking a look at this,

The Frog

2

There are 2 answers

1
Nikolay On BEST ANSWER

You could try the TEXTHEIGHT function to get around this. Specify a reasonable maximum text widht as a second parameter for it:

TxtHeight = TEXTHEIGHT(TheText,100)
TxtPinY = 0
TxtLocPinY = TxtHeight
0
y4cine On

You can use the code provided with the stencil available in this post: http://visguy.com/vgforum/index.php?topic=7461.msg31490#msg31490