InspectionPackage

WordProcessingRootPackage.InspectionPackage property

Gets a metadata package containing inspection results for the document. The package contains information about document parts that can be considered as metadata in some cases.

public WordProcessingInspectionPackage InspectionPackage { get; }

Property Value

A metadata package containing inspection results for the document.

Remarks

Learn more

Examples

This code sample shows how to inspect a WordProcessing document.

using (Metadata metadata = new Metadata(Constants.InputDocx))
{
    var root = metadata.GetRootPackage<WordProcessingRootPackage>();

    if (root.InspectionPackage.Comments != null)
    {
        foreach (var comment in root.InspectionPackage.Comments)
        {
            Console.WriteLine(comment.Author);
            Console.WriteLine(comment.CreatedDate);
            Console.WriteLine(comment.Text);

            // ... 

        }
    }

    if (root.InspectionPackage.DigitalSignatures != null)
    {
        foreach (var signature in root.InspectionPackage.DigitalSignatures)
        {
            Console.WriteLine(signature.CertificateSubject);
            Console.WriteLine(signature.Comments);
            Console.WriteLine(signature.SignTime);

            // ...
        }
    }

    if (root.InspectionPackage.Fields != null)
    {
        foreach (var field in root.InspectionPackage.Fields)
        {
            Console.WriteLine(field.Code);
            Console.WriteLine(field.Result);
        }
    }

    if (root.InspectionPackage.HiddenText != null)
    {
        foreach (var textFragment in root.InspectionPackage.HiddenText)
        {
            Console.WriteLine(textFragment);
        }
    }

    if (root.InspectionPackage.Revisions != null)
    {
         foreach (var revision in root.InspectionPackage.Revisions)
         {
             Console.WriteLine(revision.Author);
             Console.WriteLine(revision.DateTime);
             Console.WriteLine(revision.RevisionType);
          }
     }
}

See Also