Does anyone know how to handlethe enumerator MSOshapemixed?

J

John... Visio MVP

Does anyone now how to work with msoshapemixed? In other words, if a shape
has that type, what do you do next?

I am trying to walk the shape collection and understand the shapes and their
details, but I occassionaly run into a "Mixedshape". So how do I find out
what that really is?

John... Visio MVP
 
A

Andy Pope

Hi John,

Assuming the shape is reporting Mixed due to being a grouped shape then.

For each tmpShape in Activesheet.shapes(1).groupitems
Msgbox tmpShape.autoshapetype
Next

Cheers
Andy
 
J

John... Visio MVP

Thanks Andy, I'll check that out. Looks like I may have a bit of recursion
coming up in the future.

John... Visio MVP
 
A

Andy Pope

Hi Steve,

I had to double check my code as I thought I may have given John a bum
steer :)

This code produces the following output

Sub x()

Dim shpTemp As Shape

Debug.Print "Name", "AutoShapeType", "Type"
For Each shpTemp In ActiveSheet.Shapes
Debug.Print shpTemp.Name, shpTemp.AutoShapeType, shpTemp.Type
Next
Debug.Print ""
Debug.Print "msoShapeMixed", , msoShapeMixed
Debug.Print "msoShapeGroup", , msoGroup
Debug.Print "msoShapeSmartArt", msoSmartArt

End Sub

Name AutoShapeType Type
Rectangle 1 1 1
Smiley Face 2 17 1
Group 5 -2 6
Diagram 6 -2 24

msoShapeMixed -2
msoShapeGroup 6
msoShapeSmartArt 24

So I guess you would need some conditional tests using both Type and
AutoShapeType properties to determine exactly what you where dealing with.

Cheers
Andy
 
J

John... Visio MVP

Thanks Andy.

John... Visio MVP

Andy Pope said:
Hi Steve,

I had to double check my code as I thought I may have given John a bum
steer :)

This code produces the following output

Sub x()

Dim shpTemp As Shape

Debug.Print "Name", "AutoShapeType", "Type"
For Each shpTemp In ActiveSheet.Shapes
Debug.Print shpTemp.Name, shpTemp.AutoShapeType, shpTemp.Type
Next
Debug.Print ""
Debug.Print "msoShapeMixed", , msoShapeMixed
Debug.Print "msoShapeGroup", , msoGroup
Debug.Print "msoShapeSmartArt", msoSmartArt

End Sub

Name AutoShapeType Type
Rectangle 1 1 1
Smiley Face 2 17 1
Group 5 -2 6
Diagram 6 -2 24

msoShapeMixed -2
msoShapeGroup 6
msoShapeSmartArt 24

So I guess you would need some conditional tests using both Type and
AutoShapeType properties to determine exactly what you where dealing with.

Cheers
Andy
 
J

John... Visio MVP

Steve Rindsberg said:
A group should show up as .Type = 6 rather than Mixed.

Have you got a slide with one of these mixed(up) shapes you could send me,
John?

Might save considerable "Recurses, flailed again!" activity.


Okay Snidely, I'll set up a PPT sample for you. Currently I am using Word as
my testing bed.

John...
 
J

John... Visio MVP

Thanks Andy and Steve.

The problem with Andy's sample is that AutoShapeType is only relevant when
Type is 1. The Shapes collection has a long list of objects in addition to
the MSO shapes.

To see a real msoShapeMixed. Use Andy's code ( for clarity use Debug.Print
shpTemp.Name, shpTemp.Type, shpTemp.AutoShapeType) on a PPT slide that has
one of the connectors from the Insert Shape menu.

I can identify most basic MSO shapes, but the connector lines show up as
"mixed"

John...
 
J

John... Visio MVP

It appears to be most of the MSO connector shapes.

So the 64 dollar question is. Once identified, what do you do with the mixed
shapes? Or in other words, how do you unmix them.

John...
 

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