Replace Images with a "Blank" image

J

Jim

I had posted this about a week ago.. Any help would be appreciated

I need to have a powerpoint reviewed by others (including where the
text is placed on the slides) Because the images are copyrighted I
would like to replace every picture in a Powerpoint presentation with
a "blank" image. is there a way to do it in VBA

They are simple images (not an album)
 
J

John Wilson

Try this on a COPY!

If you have 2007 then some images may be missed. Post back (I seem to
remember asking last post) and I will add the extra code needed for 2007 but
note it would crash in earlier versions.

Sub rep_images()
Dim osld As Slide
Dim oshp As Shape
Dim i As Integer

For Each osld In ActivePresentation.Slides
For i = osld.Shapes.Count To 1 Step -1
Set oshp = osld.Shapes(i)
If oshp.Type = msoPicture Or oshp.Fill.Type _
= msoFillPicture Then Call zap(oshp, osld)
Next i
Next osld
End Sub

Sub zap(oshp As Shape, osld As Slide)
Dim z As Integer
With osld.Shapes.AddShape(msoShapeRectangle, _
oshp.Left, oshp.Top, oshp.Width, oshp.Height)
With .TextFrame.TextRange
..Text = "Picture Here"
..Font.Size = 24
End With
For z = oshp.ZOrderPosition To .ZOrderPosition - 1
..ZOrder (msoSendBackward)
Next z
End With
oshp.Delete
End Sub
 
J

Jim

Thanks for a great start

It seems to work some of the time. I think I isolated the problem
(but not the solution)

It appearers to "miss" if the placeholder is msoFillMixed. I cannot
figure out how to detect if the placeholder is filled with a picture
or text which is vital to know when to run zap

Also I am trying to figure out how to get the replaced text the same
size as the image it is replacing
 

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