This Microsoft Visual Basic/Visual Basic for Applications example minimizes the topmost Microsoft Outlook window if it is an inspector window.
Dim myOlApp As New Outlook.Application
If TypeName(myOlApp.ActiveWindow) = "Inspector" Then
myOlApp.ActiveWindow.WindowState = olMinimized
End If
If you use VBScript, you do not create the Application object, and you cannot use named constants. This example shows how to perform the same task using VBScript.
If TypeName(Application.ActiveWindow) = "Inspector" Then
Application.ActiveWindow.WindowState = 1
End If