Partager via


CurrentItem Property

Returns an Object representing the current item being displayed in the inspector.

Note  If no item is currently open, an error message will be returned.

expression**.CurrentItem**

*expression    * Required. An expression that returns an Inspector object.

Example

This Visual Basic for Applications (VBA) example uses the CurrentItem property to obtain the current item that the user is viewing and closes it. If no item is currently open, an error message will be returned.

Sub CloseItem()
    Dim myOlApp As New Outlook.Application
    Dim myItem As Object
    Set myItem = myOlApp.ActiveInspector.CurrentItem
    myItem.Close olSave
End Sub

Applies to | Inspector Object