selected shape within a group

A

Alex Bendig

Hi all,

I have a quick question: How can we determine the name of the currently
selected shape, if that shape is part of a group? I could certainly ungroup,
retrieve the name and then regroup, but I would like to think there is a
better way, which does not require the ungrouping/regrouping, as that also
changes the name of the group...

Any help would be appreciated.

Regards,

Alex
 
A

Alex Bendig

Keith,

That would be great - unfortunately
ActiveWindow.Selection.HasChildShapeRange appears to be "false", thus I
cannot access ChildShapeRange(1) in the manner you indicated.

Regards,
Alex
 
S

Shyam Pillai

Alex,
I don't that you can determine the active shape within a selected group
shape. It's a UI thing. The object model is limited in this regard. However,
you can iterate thru all items in the selected group by using the GroupItems
property and get references to the individual shapes in this manner.

--
Regards
Shyam Pillai

Batch Exporter
http://www.mvps.org/skp/products/xport/
 
K

Keith Tromer

I dunno, I tried it.

Created 3 Text boxes and grouped them. Selected one of the childs in the
group and it returned the correct name.

I have never actually has a use for this command, but you sparked my
interest, so I tried it.

What kind of shapes are you attempting with it?
 
S

Shyam Pillai

Keith,
I take that back. It does work. Thank you.

?ActiveWindow.Selection.ChildShapeRange.Name does work.
 
A

Alex Bendig

Well ... almost. If the user clicks on the textbox within a group (the
cursor is displayed in the box), it does not appear to work, as
ActiveWindow.Selection.HasChildRange = false. Thus, trying to access
ChildRange results in an exception. However, if the frame of the grouped
textbox is clicked (the sizing handles are displayed),
ActiveWindow.Selection.HasChildRange = false and the ChildRange can be
accessed to determine the name of the TextBox. So, I guess this would be
half a solution.

Alex
 

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