API Documentation > CorelDRAW > 2025-v26 > Document > IVGDocument
Document.ActiveWindow property
Returns the active window in the current document
Syntax:
Property Get ActiveWindow() As Window
Remarks:
The ActiveWindow property represents the active window.
Examples:
The following VBA example sets the width of the active document window to half the size of the main application window and then sets its zoom factor to 200%.
Sub Test()
Dim w As Window
Set w = ActiveDocument.ActiveWindow
w.WindowState = cdrWindowNormal
w.Width = AppWindow.Width / 2
w.ActiveView.Zoom = 200 
End Sub