First check if the document has been changed since last save by using the "XModifiable" interface. If it has been changed use the "XStorable" interface to save it before closing the document. To close a document there are 3 ways to do so: The "close" method of the "XClosable" interface, the "dispose" function of the "XComponent" interface and the "terminate" method of the "XDesktop" interface. The best way to close a document is to use the "close" method. For further details see http://wi.wu-wien.ac.at/rgf/diplomarbeiten/BakkStuff/2008/200809_Frysak/200809_Frysak_Automating_OOo_ooRexx_Nutshells.pdf. |