// Get xMultiServiceFactory interface for document
/* initialize the CompPad Document object */
nResult=0;
nError=0;
document = new Document();
/* get document url, and if it's file:// then strip this and the file name and
* set that as the document working directory */
String docURL = ((XModel)UnoRuntime.queryInterface(XModel.class, xTextDocArg)).getURL();