Windows Collection Methods

Name Returns Description

CreateTool Window Parameters: Addlnlnst, ProgId, Caption, GuidPosition,

Window DocObj. This method is only used when creating COM Add-

Ins using VB6, to create a dockable window in the VBE.

This example closes all code and designer windows in the VBE:

Sub CloseAllCodeWindows() Dim oWin As VBIDE.Window

'Loop through all the open windows in the VBE For Each oWin In Application.VBE.Windows

'Close the window, depending on its type Select Case oWin.Type

Case vbext_wt_Browser, vbext_wt_CodeWindow, vbext_wt_Designer

'Close the Object Browser, code windows and designer windows Debug.Print "Closed '" & oWin.Caption & "' window." oWin.Close

Case Else

'Don't close any other windows

Debug.Print "Kept '" & oWin.Caption & "' window open." End Select Next End Sub

0 0

Post a comment