Log in

View Full Version : Delete text and pictures from CustomLayer(3) in SlideMaster



Gest1979
10-08-2015, 06:22 AM
Hi,

I'm looking for the right code to delete all pictures and all text framea from the slideMaste customLayer Number 3.

My code ist not enough/ it does not work :-(

Sub MasterTry()

ActivePresentation.Designs(1).SlideMaster.CustomLayouts(3).Shapes.Delete

End Sub

It would be a help as well to make everything on the third slideMaster invisible.

Can anyone help?

THX

Gest1979
10-08-2015, 06:49 AM
This ist my whole macro:


Sub MasterTry()
ActivePresentation.Slides(1).Copy
ActivePresentation.Slides(1).Shapes(1).Delete
For Each Pic In ActivePresentation.Slides(1).Shapes
If msoPic Then
Pic.Delete
End If
For Each Tbox In ActivePresentation.Slides(1).Shapes
If msoTextBox Then
Tbox.Delete
End If
Next
Next
For Each Tbox In ActivePresentation.Slides(1).Shapes
If Tbox.TextFrame.HasText Then
Tbox.Delete
End If
Next

ActivePresentation.SlideMaster.Shapes(1).Delete

For Each Pic In ActivePresentation.SlideMaster.Shapes
If msoPic Then
Pic.Delete
End If
For Each Tbox In ActivePresentation.SlideMaster.Shapes
If msoTextBox Then
Tbox.Delete
End If
Next
Next
For Each Tbox In ActivePresentation.SlideMaster.Shapes
If Tbox.TextFrame.HasText Then
Tbox.Delete
End If
Next
ActivePresentation.SlideMaster.Shapes.PasteSpecial ppPasteMetafilePicture

For Each Pic In ActivePresentation.SlideMaster.Shapes
With Pic
.LockAspectRatio = msoTrue
.Height = 1100
.Width = 720
.Left = 0
.Top = 0
End With
Next

End Sub

What I need ist bold lines changed to slideMaster number 3, not the very first one.

THX

John Wilson
10-08-2015, 10:02 AM
This will delete all shapes on layout 3


Sub zapAll()
ActivePresentation.Designs(1).SlideMaster.CustomLayouts(3).Shapes.Range.Del ete
End Sub

Gest1979
10-09-2015, 01:54 AM
Thanx a lot!