Gabor
05-08-2006, 07:40 PM
I should like to create a macro which would not execute when I have more documents open and I close them one by one - until I close the very last open document and then the macro would execute.
My aim is to have the Word program open but in a minimized state after closing the last document - i.e. not to have the big gray window which actually is good for nothing but covers the whole screen.
I created the macro below but it minimizes the program each time after I close a document.
Private Sub Document_Close()
Application.WindowState = wdWindowStateMinimize
End Sub
Could somebody perhaps show me how this macro should be changed to reach my purpose?
Thank you very much.
My aim is to have the Word program open but in a minimized state after closing the last document - i.e. not to have the big gray window which actually is good for nothing but covers the whole screen.
I created the macro below but it minimizes the program each time after I close a document.
Private Sub Document_Close()
Application.WindowState = wdWindowStateMinimize
End Sub
Could somebody perhaps show me how this macro should be changed to reach my purpose?
Thank you very much.