This has been
suggested previously, and would have saved me a lot of trouble because of unexpected behavior with doc.open() and doc.save(). A method for terminating the connection to doc to ensure that all components have been written to that point would be helpful.