//
// This code is part of Document Solutions for Word demos.
// Copyright (c) MESCIUS inc. All rights reserved.
//
using System;
using System.IO;
using System.Drawing;
using System.Linq;
using GrapeCity.Documents.Word;
namespace DsWordWeb.Demos
{
// This sample shows how to clear all formatting in a DOCX.
// To see see the sample document with original formatting,
// run the SampleParagraphs sample.
public class ClearFormat
{
public GcWordDocument CreateDocx()
{
var doc = new GcWordDocument();
doc.Load(Path.Combine("Resources", "WordDocs", "SampleParagraphs.docx"));
// ClearFormatting() is defined on the RangeBase class.
// It can be applied to any range as well as to the whole
// document body (which is derived from RangeBase too):
doc.Body.ClearFormatting();
return doc;
}
}
}