Return to Snippet

Revision: 70700
at June 13, 2016 07:54 by muhammadsabir


Initial Code
/// <summary>
            /// Removes document comments of Doc file  
            /// </summary> 
            public static void RemoveComments()
            {
                try
                {

                    // initialize DocFormat
                    DocFormat docFormat = new DocFormat(Common.MapSourceFilePath(filePath));

                    // remove comments
                    docFormat.ClearComments();

                    // save file in destination folder
                    docFormat.Save(Common.MapDestinationFilePath(filePath));

                    Console.WriteLine("File saved in destination folder.");


                }
                catch (Exception exp)
                {
                    Console.WriteLine(exp.Message);
                }
            }

Initial URL
https://github.com/groupdocs-metadata/GroupDocs.Metadata-for-.NET/blob/master/Examples/GroupDocs.Metadata.Examples.CSharp/Documents.cs#L313

Initial Description
This code snippet removes any comments from a word document. The comments can be something like [this screenshot](https://www.dropbox.com/s/hm4kpqnjlniqch0/comments-word-doc.png?dl=0)

Initial Title
Remove Comments from a Word document

Initial Tags


Initial Language
C#