Welcome to the { mindfrost82.com } forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > PowerPoint

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-21-2008, 09:28 PM
Dale Fye
 
Posts: n/a
Determining whether a PPT shape has other shapes within it

I'm trying to write some code that will enumerate all of the shapes on a
slide.

Got this part working for the top level shapes, but if a shape is Group or a
diagram, or something else, how do I determine whether it has shapes
imbedded within it, and if so, how do I iterate through the shapes within
that higher level shape?

Dale


Reply With Quote
  #2 (permalink)  
Old 03-21-2008, 09:49 PM
=?Utf-8?B?dmluZHlz?=
 
Posts: n/a
RE: Determining whether a PPT shape has other shapes within it

Dim s As Shape
Set s = ActiveWindow.Selection.ShapeRange(1)
If s.Type = msoGroup Then
With s
For i = 1 To s.GroupItems.Count
's.GroupItems (i) will give you each item
Next i
End With
End If


"Dale Fye" wrote:

> I'm trying to write some code that will enumerate all of the shapes on a
> slide.
>
> Got this part working for the top level shapes, but if a shape is Group or a
> diagram, or something else, how do I determine whether it has shapes
> imbedded within it, and if so, how do I iterate through the shapes within
> that higher level shape?
>
> Dale
>
>
>

Reply With Quote
  #3 (permalink)  
Old 03-21-2008, 10:05 PM
Dale Fye
 
Posts: n/a
Re: Determining whether a PPT shape has other shapes within it

Will this work for all types of shapes that have other shapes imbedded
within them, or only "Groups"?

"vindys" <vindys@discussions.microsoft.com> wrote in message
news:8AD02676-2F38-4F6F-9F1B-905E133EB542@microsoft.com...
> Dim s As Shape
> Set s = ActiveWindow.Selection.ShapeRange(1)
> If s.Type = msoGroup Then
> With s
> For i = 1 To s.GroupItems.Count
> 's.GroupItems (i) will give you each item
> Next i
> End With
> End If
>
>
> "Dale Fye" wrote:
>
>> I'm trying to write some code that will enumerate all of the shapes on a
>> slide.
>>
>> Got this part working for the top level shapes, but if a shape is Group
>> or a
>> diagram, or something else, how do I determine whether it has shapes
>> imbedded within it, and if so, how do I iterate through the shapes within
>> that higher level shape?
>>
>> Dale
>>
>>
>>



Reply With Quote
  #4 (permalink)  
Old 03-22-2008, 05:16 AM
Steve Rindsberg
 
Posts: n/a
Re: Determining whether a PPT shape has other shapes within it

In article <ON7ujd5iIHA.4080@TK2MSFTNGP03.phx.gbl>, Dale Fye wrote:
> Will this work for all types of shapes that have other shapes imbedded
> within them, or only "Groups"?


Only Groups have other PPT shapes embedded within them; embedded OLE objects,
linked OLE objects and some pictures are embedded as WMF/EMF representations
that turn INTO shapes when ungrouped. As a general solution, you'd have to
ungroup them to get at the component shapes.



>
> "vindys" <vindys@discussions.microsoft.com> wrote in message
> news:8AD02676-2F38-4F6F-9F1B-905E133EB542@microsoft.com...
> > Dim s As Shape
> > Set s = ActiveWindow.Selection.ShapeRange(1)
> > If s.Type = msoGroup Then
> > With s
> > For i = 1 To s.GroupItems.Count
> > 's.GroupItems (i) will give you each item
> > Next i
> > End With
> > End If
> >
> >
> > "Dale Fye" wrote:
> >
> >> I'm trying to write some code that will enumerate all of the shapes on a
> >> slide.
> >>
> >> Got this part working for the top level shapes, but if a shape is Group
> >> or a
> >> diagram, or something else, how do I determine whether it has shapes
> >> imbedded within it, and if so, how do I iterate through the shapes within
> >> that higher level shape?
> >>
> >> Dale
> >>
> >>
> >>

>


--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================

Reply With Quote
  #5 (permalink)  
Old 03-22-2008, 01:03 PM
Dale Fye
 
Posts: n/a
Re: Determining whether a PPT shape has other shapes within it

Steve,

Vindy's code below helped me crack the nut for Group types 8 and 13 and
appears to handle part of the issue with shape type (14, Diagram 4).

However, with the Diagram shape, although that code did allow me to delve
into the diagram, it did not identify the types of shapes that were embedded
in the diagram, and when I went into PPT and clicked on the diagram, there
did not appear to be a way to ungroup the shapes that make it up, to give me
access to the individual shapes.

I would be interested in knowing how to do this, as well as how to ungroup
embedded OLE Objects.

Once ungrouped, I can always close the presentation without saving the
changes, but I need to be able to diassemble the entire presentation so that
I can look at each of it's component parts.

Thanks for your help

Dale

"Steve Rindsberg" <abuse@localhost.com> wrote in message
news:VA.00003e6e.0085336d@localhost.com...
> In article <ON7ujd5iIHA.4080@TK2MSFTNGP03.phx.gbl>, Dale Fye wrote:
>> Will this work for all types of shapes that have other shapes imbedded
>> within them, or only "Groups"?

>
> Only Groups have other PPT shapes embedded within them; embedded OLE
> objects,
> linked OLE objects and some pictures are embedded as WMF/EMF
> representations
> that turn INTO shapes when ungrouped. As a general solution, you'd have
> to
> ungroup them to get at the component shapes.
>
>
>
>>
>> "vindys" <vindys@discussions.microsoft.com> wrote in message
>> news:8AD02676-2F38-4F6F-9F1B-905E133EB542@microsoft.com...
>> > Dim s As Shape
>> > Set s = ActiveWindow.Selection.ShapeRange(1)
>> > If s.Type = msoGroup Then
>> > With s
>> > For i = 1 To s.GroupItems.Count
>> > 's.GroupItems (i) will give you each item
>> > Next i
>> > End With
>> > End If
>> >
>> >
>> > "Dale Fye" wrote:
>> >
>> >> I'm trying to write some code that will enumerate all of the shapes on
>> >> a
>> >> slide.
>> >>
>> >> Got this part working for the top level shapes, but if a shape is
>> >> Group
>> >> or a
>> >> diagram, or something else, how do I determine whether it has shapes
>> >> imbedded within it, and if so, how do I iterate through the shapes
>> >> within
>> >> that higher level shape?
>> >>
>> >> Dale
>> >>
>> >>
>> >>

>>

>
> --
> Steve Rindsberg, PPT MVP
> PPT FAQ: www.pptfaq.com
> PPTools: www.pptools.com
> ================================================
>



Reply With Quote
  #6 (permalink)  
Old 03-25-2008, 03:46 AM
Steve Rindsberg
 
Posts: n/a
Re: Determining whether a PPT shape has other shapes within it

> However, with the Diagram shape, although that code did allow me to delve
> into the diagram, it did not identify the types of shapes that were embedded
> in the diagram, and when I went into PPT and clicked on the diagram, there
> did not appear to be a way to ungroup the shapes that make it up, to give me
> access to the individual shapes.


This should do it, I think:

Dim oSh As Shape
Dim x As Long

' for demo purposes, assume you've selected a diagram
Set oSh = ActiveWindow.Selection.ShapeRange(1)

With oSh
For x = 1 To .GroupItems.Count
Debug.Print .GroupItems(x).Name
' deal with other properties here
Next
End With

>
> I would be interested in knowing how to do this, as well as how to ungroup
> embedded OLE Objects.


And something like his for the latter. The odd loop is because some object
when ungrouped turn into a PPT group.

Sub UngroupOLEObject()

Dim oSh As Shape
Dim oShapeRange As ShapeRange
Dim x As Long

' assume you've selected an ole embedded or linked object
Set oSh = ActiveWindow.Selection.ShapeRange(1)

Set oShapeRange = oSh.Ungroup
Do Until oShapeRange.Count > 1
Set oShapeRange = oShapeRange.Ungroup
Loop

With oShapeRange
For x = 1 To .Count
Debug.Print .Item(x).Name
Next
End With

End Sub


>
> Once ungrouped, I can always close the presentation without saving the
> changes, but I need to be able to diassemble the entire presentation so that
> I can look at each of it's component parts.
>
> Thanks for your help
>
> Dale
>
> "Steve Rindsberg" <abuse@localhost.com> wrote in message
> news:VA.00003e6e.0085336d@localhost.com...
> > In article <ON7ujd5iIHA.4080@TK2MSFTNGP03.phx.gbl>, Dale Fye wrote:
> >> Will this work for all types of shapes that have other shapes imbedded
> >> within them, or only "Groups"?

> >
> > Only Groups have other PPT shapes embedded within them; embedded OLE
> > objects,
> > linked OLE objects and some pictures are embedded as WMF/EMF
> > representations
> > that turn INTO shapes when ungrouped. As a general solution, you'd have
> > to
> > ungroup them to get at the component shapes.
> >
> >
> >
> >>
> >> "vindys" <vindys@discussions.microsoft.com> wrote in message
> >> news:8AD02676-2F38-4F6F-9F1B-905E133EB542@microsoft.com...
> >> > Dim s As Shape
> >> > Set s = ActiveWindow.Selection.ShapeRange(1)
> >> > If s.Type = msoGroup Then
> >> > With s
> >> > For i = 1 To s.GroupItems.Count
> >> > 's.GroupItems (i) will give you each item
> >> > Next i
> >> > End With
> >> > End If
> >> >
> >> >
> >> > "Dale Fye" wrote:
> >> >
> >> >> I'm trying to write some code that will enumerate all of the shapes on
> >> >> a
> >> >> slide.
> >> >>
> >> >> Got this part working for the top level shapes, but if a shape is
> >> >> Group
> >> >> or a
> >> >> diagram, or something else, how do I determine whether it has shapes
> >> >> imbedded within it, and if so, how do I iterate through the shapes
> >> >> within
> >> >> that higher level shape?
> >> >>
> >> >> Dale
> >> >>
> >> >>
> >> >>
> >>

> >
> > --
> > Steve Rindsberg, PPT MVP
> > PPT FAQ: www.pptfaq.com
> > PPTools: www.pptools.com
> > ================================================
> >

>


--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================

Reply With Quote
Reply

  { mindfrost82.com } > Gadget Corner > Tech Newsgroups > Microsoft > MS Office > PowerPoint


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 07:10 AM.


Powered by vBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.
© 1999-2008 mindfrost82.com v11.0


Sponsors:
Mortgages | Credit Cards | Remortgages | Free Advertising | Debt Consolidation



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114