Document will not process after PostSave event

Right now, I have a function that, basically, saves the document and then closes the document:

UIDoc.Save

UIDoc.Close

I also have a lot of processing on the QuerySave and PostSave event. The only thing is that when the document saves and processes though the QuerySave and PostSave events, it won’t go back to the origional function and run the UIDoc.Close. Has anyone run into this beofore or have any ideas of where to go from here?

Subject: RE: Document will not process after PostSave event

  1. got any queryclose code?

  2. do you understand that by default, uidoc.close does not close the window immediately, but waits for the script to finish executing?

  3. did the save work? If save fails, you’ll get an error condition which prevents the next statement from executing.

  4. anyway, you should have a test for whether the save worked and not try to close the document in that case.