How can I access parent group's Shape.ID when dropping shapes?

Started by kennyj, December 20, 2012, 08:57:47 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

kennyj

Hello -

I'm using Visio 2010 Premium and I'm struggling to figure out how to make shapes within a group interact via shapesheet.

Would someone please explain how to get the parent group's id from within a shape?

Basically, what I'm doing is dropping shapes onto a group, and I want the shapes to automatically size and position themselves based on characteristics of the group or other shapes within the group.

I think I understand how to accomplish that, if I could somehow generically reference the parent group's id, without knowing in advance what that id is, but I've been completely befuddled trying to get access to that info.

For instance, setting the formula of the shape's Width cell to something like "=Sheet.2!.Width" works great, if the group happened to be Sheet.2, but how do I find out what the group's actual id is?

I really appreciate any help!

Thanks,

Kenny-J




Jumpy

When working with shapesheet alone, you have to know GroupID in advance. Therefore you'll need to use VBA.

kennyj

Quote from: Jumpy on December 21, 2012, 07:35:15 AM
When working with shapesheet alone, you have to know GroupID in advance. Therefore you'll need to use VBA.

Wow, that is so surprising! Explains why it was so hard to find though :p
Thanks very much for your reply, Jumpy!
I'll have to think it through a bit more now, but I'm guessing I could use a container to kind of kludge a solution, given the ContainerSheetRef() function.