I have a shape in Visio which is a group. The group shape can have its text edited, and when it's edited I want one of the child shapes to sit just to the right of the text in the group shape.
To do this, I created a VBA function that takes the group shape as an argument, and this gets called in the TextText event on the shapesheet.
So the routine simply calls BoundingBox(visBBoxUprightText) on the group shape to get the bounds of the text and locate the sub shape to the right of the bbox. But the bounds appear to be wrong. They're coming back sometimes well to the left or well to the right of the last character.
Is the visBBoxUprightText flag supposed to mean something other than getting rectangle coordinates around the rendered text characters?
EDIT: Looking into it some more, I see that the BoundingBox method looks at the shape.type property to determine what the boundingbox encloses. If the shape type is visGroup then it's going to include the sub shapes as well, and there doesn't seem to be a flag to force it to consider the group as a simple shape.
So I guess now the question is, is there a way to get the BoundingBox of the text, ignoring sub-shapes? I tried putting a separate sub-shape to hold the text, and now it works like a charm.