WorkbookBase.DocumentInspectors 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得活頁簿的文件檢查模組集合。
public:
property Microsoft::Office::Core::DocumentInspectors ^ DocumentInspectors { Microsoft::Office::Core::DocumentInspectors ^ get(); };
public Microsoft.Office.Core.DocumentInspectors DocumentInspectors { get; }
member this.DocumentInspectors : Microsoft.Office.Core.DocumentInspectors
Public ReadOnly Property DocumentInspectors As DocumentInspectors
屬性值
Microsoft.Office.Core.DocumentInspectors 集合,其中包含活頁簿的文件檢查模組。
範例
下列程式代碼範例會逐一查看活頁簿中的偵測器。 程式代碼會檢查每一個程式代碼,並顯示消息框,以顯示偵測器的名稱,以及檢查的狀態和結果。
此範例適用於檔層級自定義。
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);
}
}
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