Here’s another simple but useful add-in you can add to your arsenal. Follow the directions given in the previous tip “Add Remarks to Your Procedures,” with only minor differences. Use the project name CloseWindows rather than RemBuilder. Also, change the description to “Close All IDE Windows.” Finally, type a suitable caption for the menu command, such as Close IDE &Windows. Insert this code in the MenuHandler_Click procedure:
Dim win As VBIDE.WindowFor Each win In VBInstance.WindowsIf win Is VBInstance.ActiveWindow Then' it's the active window, do nothingElseIf win.Type = vbext_wt_CodeWindow Or _ win.Type = vbext_wt_Designer Then' code pane or designer windowwin.CloseEnd IfNext
When you select the add-in from the Add-Ins menu, it closes all the forms and code windows currently open, except the one you’re working with.