Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Application.ActiveInspector Method (Outlook)

Returns the topmost Inspector object on the desktop.

expression .ActiveInspector

expression A variable that represents an Application object.

Return Value

An Inspector that represents the topmost inspector on the desktop.

Use this method to access the Inspector object that the user is most likely to be viewing.

If no inspector is active, returns Nothing.

This Visual Basic for Applications (VBA) example uses the ActiveInspector method to obtain the currently active Inspector object. The example saves and closes the item displayed in the active inspector without prompting the user. To run this example, you need to have an item displayed in an inspector window.

Sub CloseItem() 
 
 Dim myinspector As Outlook.Inspector 
 
 Dim myItem As Outlook.MailItem 
 
 
 
 Set myinspector = Application.ActiveInspector 
 
 Set myItem = myinspector.CurrentItem 
 
 myItem.Close olSave 
 
End Sub 
 

Show:
© 2015 Microsoft