IMO, using "DoCloseMainDocument" is better.