ClearFormat.vb
  1. ''
  2. '' This code is part of Document Solutions for Word demos.
  3. '' Copyright (c) MESCIUS inc. All rights reserved.
  4. ''
  5. Imports System.IO
  6. Imports System.Drawing
  7. Imports System.Linq
  8. Imports GrapeCity.Documents.Word
  9.  
  10. '' This sample shows how to clear all formatting in a DOCX.
  11. '' To see see the sample document with original formatting,
  12. '' run the SampleParagraphs sample.
  13. Public Class ClearFormat
  14. Public Function CreateDocx() As GcWordDocument
  15. Dim doc = New GcWordDocument()
  16. doc.Load(Path.Combine("Resources", "WordDocs", "SampleParagraphs.docx"))
  17.  
  18. '' ClearFormatting() Is defined on the RangeBase class.
  19. '' It can be applied to any range as well as to the whole
  20. '' document body (which Is derived from RangeBase too):
  21. doc.Body.ClearFormatting()
  22. Return doc
  23. End Function
  24. End Class
  25.