Thank you, but there are some problems with your suggestions:
In the first suggestion, I must be include a "Handled:=True;" for it to work.
In the second suggestion, sometimes I need to keep the messages in the Save dialog box and if I change the "IDECloseAction" property at run time the messages are still displayed.
Apparently the IDECloseAction property cannot be changed after the IDE is displayed.