This Visual Basic for Applications example uses the CurrentItem property to obtain the current item that the user is viewing. If there is no currently open item, an error will be returned.
Set myOlApp = CreateObject("Outlook.Application")
On Error Resume Next
Set myItem = myOlApp.ActiveInspector.CurrentItem