Aspose.Plugins.AsposeVSOpenXML.Program.ExtractComments C# (CSharp) Method

ExtractComments() public static method

public static ExtractComments ( Document doc ) : void
doc Document
return void
        public static void ExtractComments(Document doc)
        {
            ArrayList collectedComments = new ArrayList();
            // Collect all comments in the document
            NodeCollection comments = doc.GetChildNodes(NodeType.Comment, true);
            // Look through all comments and gather information about them.
            foreach (Comment comment in comments)
            {
                collectedComments.Add(comment.Author + " " + comment.DateTime + " " + comment.ToString(SaveFormat.Text));
            }
            foreach (string collectedComment in collectedComments)
            {
                Console.WriteLine(collectedComment);
            }
           
        }
    }