// For complete examples and data files, please go to https://github.com/groupdocsmetadata/GroupDocs_Metadata_NET
// initialize DocFormat
DocFormat docFormat = new DocFormat(Common.MapSourceFilePath(filePath));
// inspect document
InspectionResult inspectionResult = docFormat.InspectDocument();
// display comments
if (inspectionResult.Comments.Length > 0)
{
Console.WriteLine("Comments in document:");
foreach (DocComment comment in inspectionResult.Comments)
{
Console.WriteLine("Comment: {0}", comment.Text);
Console.WriteLine("Author: {0}", comment.Author);
Console.WriteLine("Date: {0}", comment.CreatedDate);
}
}
// display merge fields
if (inspectionResult.Fields.Length > 0)
{
Console.WriteLine("\nMerge Fields in document:");
foreach (DocField field in inspectionResult.Fields)
{
Console.WriteLine(field.Name);
}
}
// display hidden fields
if (inspectionResult.HiddenText.Length > 0)
{
Console.WriteLine("\nHiddent text in document:");
foreach (string word in inspectionResult.HiddenText)
{
Console.WriteLine(word);
}
}