View Single Post
 
Old 03-05-2012, 12:40 PM
JohnWilson JohnWilson is offline Windows 7 64bit Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,913
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

Just for the record here's how to do it with an array.

Code:
Sub Group_Pic2()
Dim osld As Slide
Dim oshp As Shape
Dim x As Integer
'using a dynamic array
Dim myray() As String
Set osld = ActivePresentation.Slides(1)
ReDim myray(1 To 1)
For Each oshp In osld.Shapes
If oshp.Type = msoPicture Then
x = x + 1
myray(x) = oshp.Name
ReDim Preserve myray(1 To UBound(myray) + 1)
End If
Next oshp
'strip the empty top value
ReDim Preserve myray(1 To UBound(myray) - 1)
If UBound(myray) > 1 Then _
osld.Shapes.Range(myray()).Group
End Sub
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials
Reply With Quote