Consulting

Results 1 to 4 of 4

Thread: Delete text and pictures from CustomLayer(3) in SlideMaster

  1. #1

    Delete text and pictures from CustomLayer(3) in SlideMaster

    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

  2. #2
    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
    Last edited by SamT; 10-08-2015 at 07:43 AM.

  3. #3
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,094
    Location
    This will delete all shapes on layout 3

    Sub zapAll()
    ActivePresentation.Designs(1).SlideMaster.CustomLayouts(3).Shapes.Range.Delete
    End Sub
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  4. #4
    Thanx a lot!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •