Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save GroupDocsGists/5ef3a2f9b99dd2526db91a5b34857963 to your computer and use it in GitHub Desktop.
Save GroupDocsGists/5ef3a2f9b99dd2526db91a5b34857963 to your computer and use it in GitHub Desktop.
' For complete examples and data files, please go to https://github.com/groupdocs-watermark/GroupDocs.Watermark-for-.NET
Using doc As WordsDocument = Document.Load(Of WordsDocument)(Utilities.MapSourceFilePath(FilePath))
For Each section As WordsSection In doc.Sections
For i As Object = section.Shapes.Count - 1 To 0 Step -1
For Each fragment As Object In section.Shapes(i).FormattedTextFragments
If fragment.ForegroundColor = Color.Red AndAlso fragment.Font.FamilyName = "Arial" Then
section.Shapes.RemoveAt(i)
Exit For
End If
Next
Next
Next
doc.Save()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment