"Text" attribute for an Org.Chart Position Shape

H

Helge

Hi

In VBA I'm creating a orgchart build out of OrgChart Position Shapes.
I use the shape.Text attribute to hold the text for the node.

The problem: There seem to be a limitation of how many characters this
"Text" attribute can hold.
I can't get more than 40 characters into the attribute.
It get no error message when running the code, it just holds the first 40
chars of the string I try to put into the atrribute.
The code is like this:
lo_to_shape.Text = ls_nodetext

When I look at the nodes in the generated OrgChart, the text in the nodes
(which I put into lo_to_shape.Text) is
found in the Custom property "Name".
And weird; If I select the node and then right click and choose Properties,
I can add more text to the "Name" property.
At this point there seem to be no limit of max 40 characters.

Any ideas of how to get around this limitation?
Or, is there another attribute that I can use to programatically set the
text for the node?

regards,
Helge
 
C

Chris Roth [ Visio MVP ]

The code behind the OrgChart shapes takes direct input to the shape and
stuffs it into the Prop.Name, etc cells. It seems to be analyzing your text
when you set Shape.Text.

I would try setting the Name property via code. In this way, you're "acting
more like a user":

Dim sText as string
sText="This sentence is exactly 44 characters long."
' Need to wrap quotations around sText, since it's a string, not a
number:
visShp.CellsU("Prop.Name").FormulaU = chr(34) & sText& chr(34)



--

Hope this helps,

Chris Roth
Visio MVP
 

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