API Documentation > CorelDRAW > 2025-v26 > Document > IVGDocument
Document.Windows property
Returns the Windows collection, which represents all document windows belonging to the current document
Syntax:
Property Get Windows() As Windows
Remarks:
The Windows property returns the Windows collection, which represents all document windows. A document can have more than one document window at a time. This collection contains document windows belonging to one document only.
Examples:
The following VBA example looks through each open document and its windows and closes all of the windows, leaving open only one window per document.
Sub WindowsItem()
Dim d As Document
Dim w As Window
For Each d In Documents
  For Each w In d.Windows

 If w.Index <> 1 Then w.Close

 Next w
  Next d

End Sub