Ungroup pictures (jpeg + text

P

Paul

Hello
I am using powerpoint 2003. I have several large presentations (200+
slides) where I want to ungroup pictures (jpegs) that have been
grouped with a text caption.

Using below code, I always get Run-Time Error 70,permission denied.

any suggestions?

thanks!

-paul

Sub UngroupEveryDarnThing()

Dim AllSlides As Slides
Dim SingleSlide As Slide
Dim PhotosCaptions As Shapes
Dim Photo As Shape
Dim numberslide As ShapeRange
Dim x As Long
Set AllSlides = ActivePresentation.Slides
For Each SingleSlide In AllSlides
Set PhotosCaptions = SingleSlide.Shapes
For Each Photo In PhotosCaptions

If Photo.Type = msoPicture Then

Set numberslide = Photo.Ungroup

End If
Next Photo
Next SingleSlide

End Sub
 
D

David Marcovitz

That is because your trying to ungroup things that aren't groups. You
need to test to see:

If Photo.Type = msoGroup Then

If the thing you hit upon is of type msoPicture, it is not part of a
group.

--David
 
P

Paul

Well,

that makes sense.

many thanks!

-paul




That is because your trying toungroupthings that aren't groups. You
need to test to see:

If Photo.Type = msoGroup Then

If the thing you hit upon is of type msoPicture, it is not part of a
group.

--David
 
P

Paul

Not exactly - the slides are created by an outside vendor who put a
caption on each and every slide, with a jpeg.
 
J

John Wilson

That's good because Photo Albums don't ungroup.

Maybe this code will get you started

Sub ungrp()
Dim osld As Slide
Dim oshp As Shape
Dim i As Integer
For Each osld In ActivePresentation.Slides
For Each oshp In osld.Shapes
'check for group
If oshp.Type = msoGroup Then
'check for pic in group
For i = 1 To oshp.GroupItems.Count
If oshp.GroupItems(i).Type = msoPicture Then
oshp.Ungroup
Exit For
End If
Next i
End If
Next oshp
Next osld
End Sub
--

john ATSIGN PPTAlchemy.co.uk
Custom vba coding and PPT Makeovers
Free PPT Hints, Tips and Tutorials
http://www.pptalchemy.co.uk/powerpoint_hints_and_tips_tutorials.html
 

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