loProject = _vfp.ActiveProject FOR lnI = 1 TO loProject.FILES.COUNT lcFileExt = UPPER(JUSTEXT( loProject.FILES[lnI].NAME)) if lcFileExt = 'SCX' && this a form file modify form (loProject.FILES[lnI].NAME) nowait aselobj(arr) && would this work? arr[1].WindowType = 1 && Modal keyboard '{Ctrl + W}' && an attempt to close the form endif nextThat's from the top of my head and not tested at all. You may need to work out the details.