Share via


DocumentInspector.Inspect Method

Office Developer Reference

Inspects a document for specific information or document properties.

Syntax

expression.Inspect(Status, Results)

expression   An expression that returns a DocumentInspector object.

Parameters

Name Required/Optional Data Type Description
Status Required MsoDocInspectorStatus An enumeration representing that status of the document. Status is an output parameter which means that its value is returned when the method has completed its purpose.
Results Required String Contains a lists the information items or document properties found in the document.

Remarks
MsoDocInspectorStatus members

Constant Value
msoDocInspectorStatusDocOk 0
msoDocInspectorStatusIssueFound 1
msoDocInspectorStatusError 2

Example

The following example inspects a document using Inspect method of the DocumentInspector object and then displays the status and results of the inspection.

Visual Basic for Applications
  Public Sub DI_InspectDocument()
Dim docStatus As MsoDocInspectorStatus
Dim result As String
ActiveDocument.DocumentInspectors(1).Inspect docStatus, results

MsgBox ("The inspection returned the following status " & docStatus & _ " with this result " & result) End Sub

See Also