Windows Property

Returns a Windows collection representing the open windows in the application or active project. Read-only.

Remarks

The Windows property duplicates the Windows2 property, except that it returns a Windows collection rather than a Windows2 collection. The Windows2 Property and Windows2 Collection Object is recommended for all new development both in VBA and for external applications developed with the .NET Framework. The Windows property and Windows collection is maintained for backward compatibility with existing applications.

Example

The following example cascades all the open windows.

Sub CascadeWindows()
    Dim I As Integer
    
    ActiveWindow.WindowState = pjNormal ' Restore the window.
    
    With Application.Windows
        For I = 1 To .Count
            .Item(I).Activate
            .Item(I).Top = (I - 1) * 15
            .Item(I).Left = (I - 1) * 15
        Next I
    End With
    
End Sub

Applies to | Application Object

See Also | ActiveWindow Property | Window Object, Windows Collection Object