Windows2 Property

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

Syntax

expression.Windows2

*expression   *     Required. An expression that returns an Application or a Project object.

Remarks

The Windows2 property is recommended, in place of the Windows property, for all new development in VBA and external applications developed with the .NET Framework.

Example

The following example cascades all the open windows.

Sub CascadeWindows()
    Dim I As Integer
    
    ActiveWindow.WindowState = pjNormal ' Restore the window.
    
    With Application.Windows2
        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 | Project Object, Projects Collection Object

See Also | ActiveWindow Property | Caption Property | DisplayWindowsInTaskBar Property | Windows2 Object, Windows2 Collection Object