How to get callout text

J

JeanineG

I am using a stencil from another company which has shapes for its products.
These shapes are groupings of shapes and contain callouts with text
describing parts of each product. How do I get the text from the callouts
using VBA?
 
C

Chris Roth [Visio MVP]

Hi Jeannie,

If the callouts are inside of groups, you have to recurse through the
groups. This is fairly easy, because every shape has a shapes collection:

Have a look at this snippet:

Dim shpGrp as Visio.Shape, shpSub as Visio.Shape
Set shpGrp = Visio.ActiveWindow.Selection(1)
For Each shpSub in shpGrp.Shapes

Debug.Print shpSub.Text
Debug.Print shpSub.Characters.Text 'In case text is an inserted field

Next shpSub
--
Hope this helps,

Chris Roth
Visio MVP


Visio Guy: Smart Graphics for Visual People

Articles: http://www.visguy.com
Shapes: http://www.visguy.com/shapes
Dev: http://www.visguy.com/category/development/
Forum: http://www.viguy.com/vgforum
 

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