Inspectors.Add Method (Outlook)
Creates a new inspector window.
expression A variable that represents an Inspectors object.
The item to display in the inspector window when it is created.
An Inspector object that represents a new inspector window.
This method is essentially identical to the GetInspector property of an Outlook item, such as MailItem.
This Microsoft Visual Basic for Applications (VBA) example prompts the user for a company name, uses the Restrict method to locate all contact items in the Contacts folder with that name, and displays each one.
Sub DisplayMyContacts() Dim myFolder As Folder Dim myItems As Items Dim myRestrictItems As Items Dim answer As String Dim filter As String Dim myInspector As Inspector Dim x As Integer answer = InputBox("Enter the company name") Set myFolder = Application.GetNamespace("MAPI") _ .GetDefaultFolder(olFolderContacts) filter = "[MessageClass] = 'IPM.Contact' AND [CompanyName] = '" & answer & "'" Set myItems = myFolder.Items Set myRestrictItems = myItems.Restrict(filter) For x = 1 To myRestrictItems.Count Set myInspector = Application.Inspectors.Add(myRestrictItems.Item(x)) myInspector.Display Next x End Sub