usmanazizgroupdocs
7/5/2017 - 6:26 AM

RemoveTextShapesWithParticularTextFormattingPowerPoint.vb

' For complete examples and data files, please go to https://github.com/groupdocs-watermark/GroupDocs.Watermark-for-.NET
Using doc As SlidesDocument = Document.Load(Of SlidesDocument)(Utilities.MapSourceFilePath(FilePath))
    For Each slide As SlidesSlide In doc.Slides
        For i As Object = slide.Shapes.Count - 1 To 0 Step -1
            For Each fragment As Object In slide.Shapes(i).FormattedTextFragments
                If fragment.ForegroundColor = Color.Red AndAlso fragment.Font.FamilyName = "Arial" Then
                    slide.Shapes.RemoveAt(i)
                    Exit For
                End If
            Next
        Next
    Next
    doc.Save()