WorkbookBase.DocumentInspectors Property

Gets the collection of Document Inspector modules for the workbook.

Namespace:  Microsoft.Office.Tools.Excel
Assembly:  Microsoft.Office.Tools.Excel.v4.0.Utilities (in Microsoft.Office.Tools.Excel.v4.0.Utilities.dll)

public DocumentInspectors DocumentInspectors { get; }

Property Value

Type: DocumentInspectors
A Microsoft.Office.Core.DocumentInspectors collection that contains the Document Inspector modules for the workbook.

The following code example iterates through the inspectors in the workbook. The code inspects each one and shows a message box that displays the name of the inspector, and the status and results of the inspection.

This example is for a document-level customization.

private void GetDocumentInspectors()
    foreach (Office.DocumentInspector insp in this.DocumentInspectors)
        Office.MsoDocInspectorStatus status;
        string results = String.Empty;
        insp.Inspect(out status, out results);
        MessageBox.Show("Inspector Name: " + insp.Name 
            + "\r\nStatus: " + status.ToString() + "\r\nResults: "
            + results);