Knowing when an object can be ungrouped programmatically

P

Purvi

Hi,

I've a macro that ungroups embedded objects, grouped
objects and pictures. When you try to ungroup an object
manually, if further ungrouping is not possible, then the
ungroup option is grayed out.
Is there a way to find out programmatically if the object
cannot be ungrouped?

Thanks,
Purvi
 
J

Jezebel

It's a bit cludgy, but you can use:

on error resume next
p = Shape.GoupItems.Count
IsGrouped = (Err.Number = 0)
on error goto 0

or more simply

on error resume next
Shape.Ungroup
if err.number <> 0 then
... not grouped
 

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