Search notes:

VB Editor Object Model: Windows

Iterating over the windows collection

option explicit

sub iterateVBEditorWindows()

    dim wndType as string

    dim wnd as vbide.window
    for each wnd in application.vbe.windows

        if      wnd.type = vbext_wt_codeWindow     then wndType = "code"       _
        else if wnd.type = vbext_wt_projectWindow  then wndType = "project"    _
        else if wnd.type = vbext_wt_immediate      then wndType = "immediate"  _
        else if wnd.type = vbext_wt_locals         then wndType = "locals"     _
        else if wnd.type = vbext_wt_watch          then wndType = "watch"      _
        else if wnd.type = vbext_wt_propertyWindow then wndType = "property"   _
        else if wnd.type = vbext_wt_toolBox        then wndType = "toolBox"    _
        else                                            wndType =  wnd.type

        debug.print wnd.caption & " (" & wndType & ") @ " & wnd.top & "," & wnd.left & " " & wnd.width & "x" & wnd.height
      '
      ' wnd.windowState is one of normal, maximize, minimize
      '

    next wnd

end sub

See also

The Window object.
Microsoft Office: VB Editor Object Model

Index