Skip to content

Latest commit

 

History

History
67 lines (35 loc) · 1.51 KB

Outlook.Application.ActiveInspector.md

File metadata and controls

67 lines (35 loc) · 1.51 KB
title keywords f1_keywords api_name ms.assetid ms.date ms.localizationpriority
Application.ActiveInspector method (Outlook)
vbaol11.chm713
vbaol11.chm713
Outlook.Application.ActiveInspector
3f2b6491-7b4b-8165-327e-b319711d5656
06/08/2017
medium

Application.ActiveInspector method (Outlook)

Returns the topmost Inspector object on the desktop.

Syntax

expression. ActiveInspector

expression A variable that represents an Application object.

Return value

An Inspector that represents the topmost inspector on the desktop.

Remarks

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

If no inspector is active, returns Nothing.

Example

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

See also

Application Object

[!includeSupport and feedback]