Ordering of shapes in Shapes collection

C

Chris

I'm using the Visio 2003 COM interface to process the shapes in a Visio file
and I need to process the shapes in a particular order. Does anybody know
if there is any easy way in Visio to alter the ordinal position of shapes in
the Shapes collection?

I know I could add a custom property "Sequence number" to each shape and
then get my application to re-order the shapes but this is not practial due
to the large numbers of shapes being used.
 
C

Chris Roth [ Visio MVP ]

You can build a new selection.

Page.CreateSelection....

You just take the shapes one by one from Page.Shapes and put them into
CreateSelection in the order that you want.

Or, you can get shapes from a collection by ID or Guid or Name ...
Shapes.ItemID( ). You could create an array of structs that contained, say
Text & ID by the text. Then sort that array by Text, then access the shapes
by ID in the corresponding order of the struct array.

Many possibilities...

--

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