Explorer.WindowState Property (Outlook)

Office 2013 and later
GitHub-Mark-64px

Contribute to this content

Use GitHub to suggest and submit changes. See our guidelines for contributing to VBA documentation.

Returns or sets the property with a constant in the OlWindowState enumeration specifying the window state of an explorer or inspector window. Read/write.

expression .WindowState

expression A variable that represents an Explorer object.

This Microsoft Visual Basic for Applications example minimizes all open explorer windows. It uses the Count property and Item method of the Explorers collection to enumerate the open explorer windows.

Sub MinimizeWindows() 
 
 Dim myOlExp As Outlook.Explorer 
 
 Dim myOlExps As Outlook.Explorers 
 
 
 
 Set myOlExps = Application.Explorers 
 
 For x = 1 To myOlExps.Count 
 
 myOlExps.Item(x).WindowState = olMinimized 
 
 Next x 
 
End Sub
Show: