Freigeben über


WorkbookBase.DocumentInspectors-Eigenschaft

Ruft die Auflistung von Modulen des Dokument-Inspektors für die Arbeitsmappe ab.

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

Syntax

'Declaration
Public ReadOnly Property DocumentInspectors As DocumentInspectors
    Get
public DocumentInspectors DocumentInspectors { get; }

Eigenschaftswert

Typ: Microsoft.Office.Core.DocumentInspectors
Eine Microsoft.Office.Core.DocumentInspectors-Auflistung, die die Module des Dokument-Inspektors für die Arbeitsmappe beinhaltet.

Beispiele

Im folgenden Codebeispiel werden die Inspektoren in der Arbeitsmappe durchlaufen. Jeder Inspektor wird im Code überprüft, und ein Meldungsfeld wird angezeigt, das den Namen des Inspektors sowie den Status und die Ergebnisse der Überprüfung anzeigt.

Dieses Beispiel bezieht sich auf eine Anpassung auf Dokumentebene.

Private Sub GetDocumentInspectors()
    For Each insp As Office.DocumentInspector In Me.DocumentInspectors
        Dim status As Office.MsoDocInspectorStatus
        Dim results As String = String.Empty
        insp.Inspect(status, results)
        MessageBox.Show("Inspector Name: " + insp.Name + vbCrLf _
            + "Status: " + status.ToString() + vbCrLf + "Results: " _
            + results)
    Next
End Sub
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);
    }
}

.NET Framework-Sicherheit

Siehe auch

Referenz

WorkbookBase Klasse

Microsoft.Office.Tools.Excel-Namespace