次の方法で共有


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

Concepts

Application Object Members

Application Object