Referencing shapes inside a group

N

nyar

Using C, how would you reference a shape inside of a group?

I currently use the following code to iterate through the shapes, but I can't figure out how to iterate through the subshapes.

// temp vars
long nShapeCount = 0;
long nShapeIndex = 0;

// get shape count
hr = pShapes->Count(&nShapeCount);

// index is 1 to ShapeCount in Visio
for(nShapeIndex = 1; nShapeIndex <= nShapeCount; nShapeIndex++)
{
// get shape
hr = pShapes->Item(VVariant(nShapeIndex), vsCurrentShape);

//I WANT TO ITERATE THROUGH vsCurrentShapes GROUP SHAPES HERE!
}

Any information is appreciated.
 
H

Heidi Munson [MSFT]

The shape object has a shapes property that returns a shapes collection.
Walking all the sub-shapes in a shape is usually done recursively.
There is a "Group-sub Shape Count" sample in the Visio 2003 SDK code
librarian database under the shapes node. All code librarian samples are
in C#, VB.net and VB.
Download the SDK here,
http://www.microsoft.com/downloads/details.aspx?familyid=557120bd-b0bb-46e7-936a-b8539898d44d

-Heidi
Microsoft Corporation

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

nyar said:
Using C, how would you reference a shape inside of a group?

I currently use the following code to iterate through the shapes, but I
can't figure out how to iterate through the subshapes.
 

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